产品名称找不到数据库类型:[SPARK SQL]

发布于 2025-02-03 04:10:24 字数 1033 浏览 3 评论 0 原文

我在将弹簧批量与数据链球协会连接时面临此问题。

这就是我创建数据源的方式,

  @Bean(name = "dataSource")
   public DataSource dataSource(){
   DriverManagerDataSource source= new DriverManagerDataSource();
    source.setUrl("URL");
    source.setUsername("userName");
    source.setPassword("Password");
    source.setDriverClassName("com.simba.spark.jdbc41.Driver");
    return driverManagerDataSource;
}   

这是我在进一步调试时在春季批处理项目读取器中读取它的方式

     JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
    List<Employee> employeeData=  jdbcTemplate.query("select * from employee", new EmployeeMapper());

,我可以将“ databaseproductname”视为“ spark sql”,在弹簧批处理和spring batch

DERBY("Apache Derby"),
DB2("DB2"),
DB2VSE("DB2VSE"),
DB2ZOS("DB2ZOS"),
DB2AS400("DB2AS400"),
HSQL("HSQL Database Engine"),
SQLSERVER("Microsoft SQL Server"),
MYSQL("MySQL"),
ORACLE("Oracle"),
POSTGRES("PostgreSQL"),
SYBASE("Sybase"),
H2("H2"),
SQLITE("SQLite");

和我会发现此错误数据库的产品名称:[SPARK SQL]

I am facing this issue while connecting Spring Batch with DataBricks.

Here's is how i am creating DataSource

  @Bean(name = "dataSource")
   public DataSource dataSource(){
   DriverManagerDataSource source= new DriverManagerDataSource();
    source.setUrl("URL");
    source.setUsername("userName");
    source.setPassword("Password");
    source.setDriverClassName("com.simba.spark.jdbc41.Driver");
    return driverManagerDataSource;
}   

This is how i am reading it in Spring Batch Item Reader

     JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
    List<Employee> employeeData=  jdbcTemplate.query("select * from employee", new EmployeeMapper());

While i debugged further , i can see the "databaseProductName" as "Spark SQL" which is not supported in the list of available DataTypes in Spring batch

DERBY("Apache Derby"),
DB2("DB2"),
DB2VSE("DB2VSE"),
DB2ZOS("DB2ZOS"),
DB2AS400("DB2AS400"),
HSQL("HSQL Database Engine"),
SQLSERVER("Microsoft SQL Server"),
MYSQL("MySQL"),
ORACLE("Oracle"),
POSTGRES("PostgreSQL"),
SYBASE("Sybase"),
H2("H2"),
SQLITE("SQLite");

and i get this error DatabaseType not found for product name: [Spark SQL]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不语却知心 2025-02-10 04:10:24

默认情况下不支持Spark SQL。如果您认为Spring Batch提供的DDL脚本之一足够接近以激发SQL,则可以使用

请检查有关非标准作业存储库的配置的更多详细信息。

Spark SQL is not supported by default. If you think one of the DDL scripts provided by Spring Batch is close enough to Spark SQL, you can set the database type using JobRepositoryFactoryBean#setDatabaseType.

Please check Non-standard Database Types in a Repository for more details about the configuration of non standard job repositories.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文