-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
🐛 Source CockroachDB: Fix cockroach Datatypes #7819
🐛 Source CockroachDB: Fix cockroach Datatypes #7819
Conversation
/test connector=connectors/source-cockroachdb
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
if ("numeric".equalsIgnoreCase(columnType)) { | ||
final double value = resultSet.getDouble(index); | ||
node.put(columnName, value); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be an else
branch here? Otherwise the result may be ignored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added else statement and handling of SQLException as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know what types may go to the else
branch or give a SQLException
? Depending on what type it can be, defaulting to null
may or may not be the best solution.
@@ -315,25 +302,21 @@ protected void initTests() { | |||
.addExpectedValues("a", "abc", "Миші йдуть;", "櫻花分店", "", null, "\\xF0\\x9F\\x9A\\x80") | |||
.build()); | |||
|
|||
// TODO https://github.com/airbytehq/airbyte/issues/4408 | |||
// JdbcUtils-> DATE_FORMAT is set as ""yyyy-MM-dd'T'HH:mm:ss'Z'"" for both Date and Time types. | |||
// So Time only (04:05:06) would be represented like "1970-01-01T04:05:06Z" which is incorrect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is still relevant since the returned value still have 1970-01-01 in the full date string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Returned back the comment, regarding the DateTime format. However, all java source connectors will send full DateTime in JSON for now. As we need standardization for all related DateTime formats.
Please, see:
public static final String DATE_FORMAT_PATTERN = "yyyy-MM-dd'T'HH:mm:ss'Z'"; |
So this behavior will be changed when we will sure all destination connectors are able to parse date and time formats.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Make sense.
.addNullExpectedValue() | ||
.build()); | ||
|
||
// https://github.com/airbytehq/airbyte/issues/4408 | ||
// TODO JdbcUtils-> DATE_FORMAT is set as ""yyyy-MM-dd'T'HH:mm:ss'Z'"" for both Date and Time types. | ||
// So Time only (04:05:06) would be represented like "1970-01-01T04:05:06Z" which is incorrect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for this comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same is related to this one.
/test connector=connectors/source-cockroachdb
|
/publish connector=connectors/source-cockroachdb
|
* BUG-4408: Fix cockroach connectors. * BUG-4408: Handling of spacial DB datatype for Cockroach DB. * BUG-4408: Documentation updates. * BUG-4408: Fix unit test. * BUG-4408: Fixed comments. * BUG-4408: Reformat. * BUG-4408: Bumped spec.
What
SQLException appears in some cases during parsing of Cockroach DB datatypes. Fixed such cases.
How
Override methods from
JdbcSourceOperations.java
. Created customCockroachJdbcSourceOperations.java
class.Recommended reading order
x.java
Pre-merge Checklist
Expand the relevant checklist and delete the others.
New Connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/SUMMARY.md
docs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampledocs/integrations/README.md
airbyte-integrations/builds.md
Airbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing./publish
command described hereUpdating a connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampleAirbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing./publish
command described hereConnector Generator
-scaffold
in their name) have been updated with the latest scaffold by running./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates
then checking in your changes