Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bugfix][plugin][rdbms] 1.DataBaseType should not be call set method,so that the driver is error when rdbmsreader to rdbmswriter 2.hive jdbc don't support method(Timestamp getTimestamp(int columnIndex, Calendar cal)) 3.DataBaseType add vertica driver #1188

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

awol2005ex
Copy link
Contributor

[bugfix][plugin][rdbms]
1.DataBaseType should not be call set method,so that the driver is error when rdbmsreader to rdbmswriter
2.hive jdbc don't support method(Timestamp getTimestamp(int columnIndex, Calendar cal))

3.DataBaseType add vertica driver

1.DataBaseType should not be call set method,so that the driver is error when rdbmsreader to rdbmswriter
2.hive jdbc don't support method(Timestamp getTimestamp(int columnIndex, Calendar cal))

3.DataBaseType add vertica driver
@@ -50,7 +50,15 @@ public enum DataBaseType
Sybase("sybase", "com.sybase.jdbc4.jdbc.SybDriver"),
Databend("databend", "com.databend.jdbc.DatabendDriver"),
Access("access","net.ucanaccess.jdbc.UcanaccessDriver"),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot list all the database JDBC driver classes in this class. For drivers not specified in this class, you can resolve this by specifying the driver configuration item in the job configuration file. For more details, please refer to https://wgzhao.github.io/Addax/latest/reader/rdbmsreader/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the setDriverClass method of the DataBaseType enum class can cause errors from rdbmsreader to rdbmswriter, I have to add drivers for as many database types as possible.

@@ -272,7 +272,12 @@ protected Column createColumn(ResultSet rs, ResultSetMetaData metaData, int i)
return new DateColumn(rs.getDate(i));

case Types.TIMESTAMP:
return new TimestampColumn(rs.getTimestamp(i, Calendar.getInstance()));
if(!"org.apache.hive.jdbc.HiveDriver".equals(this.dataBaseType.getDriverClassName())){
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the hivereader plugin, you can achieve specific handling for reading the Timestamp type by overriding the createColumn method. You can refer to the implementation in the following link for guidance:https://github.com/wgzhao/Addax/blob/master/plugin/reader/postgresqlreader/src/main/java/com/wgzhao/addax/plugin/reader/postgresqlreader/PostgresqlReader.java

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it needs to be encapsulated into a unified script, hivereader will not be used, but rdbmsreader will be used instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants