[jira] [Work logged] (BEAM-4700) JDBC driver cannot support TIMESTAMP data type
[ https://issues.apache.org/jira/browse/BEAM-4700?focusedWorklogId=124127=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-124127 ] ASF GitHub Bot logged work on BEAM-4700: Author: ASF GitHub Bot Created on: 17/Jul/18 16:23 Start Date: 17/Jul/18 16:23 Worklog Time Spent: 10m Work Description: kennknowles closed pull request #5919: [BEAM-4700] [SQL] Default timezone is UTC URL: https://github.com/apache/beam/pull/5919 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/JdbcDriver.java b/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/JdbcDriver.java index 75a2e901eba..dd951d5ab00 100644 --- a/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/JdbcDriver.java +++ b/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/JdbcDriver.java @@ -30,6 +30,7 @@ import org.apache.beam.sdk.extensions.sql.meta.provider.TableProvider; import org.apache.beam.sdk.options.PipelineOptions; import org.apache.beam.sdk.util.ReleaseInfo; +import org.apache.calcite.avatica.BuiltInConnectionProperty; import org.apache.calcite.avatica.ConnectStringParser; import org.apache.calcite.avatica.ConnectionProperty; import org.apache.calcite.config.CalciteConnectionProperty; @@ -86,6 +87,7 @@ public Connection connect(String url, Properties info) throws SQLException { final BeamCalciteSchema beamCalciteSchema = (BeamCalciteSchema) info.get(BEAM_CALCITE_SCHEMA); Properties info2 = new Properties(info); +setDefault(info2, BuiltInConnectionProperty.TIME_ZONE, "UTC"); setDefault(info2, CalciteConnectionProperty.LEX, Lex.JAVA.name()); setDefault( info2, diff --git a/sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/impl/JdbcDriverTest.java b/sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/impl/JdbcDriverTest.java index f5215c9a8d3..bb96b300ee7 100644 --- a/sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/impl/JdbcDriverTest.java +++ b/sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/impl/JdbcDriverTest.java @@ -206,7 +206,6 @@ public void testSelectsFromExistingTable() throws Exception { } @Test - @Ignore("https://issues.apache.org/jira/browse/CALCITE-2394;) public void testTimestampWithDefaultTimezone() throws Exception { TestTableProvider tableProvider = new TestTableProvider(); Connection connection = JdbcDriver.connect(tableProvider); This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 124127) Time Spent: 2h 50m (was: 2h 40m) > JDBC driver cannot support TIMESTAMP data type > -- > > Key: BEAM-4700 > URL: https://issues.apache.org/jira/browse/BEAM-4700 > Project: Beam > Issue Type: Bug > Components: dsl-sql >Reporter: Kenneth Knowles >Assignee: Andrew Pilloud >Priority: Major > Time Spent: 2h 50m > Remaining Estimate: 0h > > Avatica allows column representation to be customized, so a timestamp can be > stored as a variety of types. Joda ReadableInstant is none of these types: > https://github.com/apache/calcite-avatica/blob/acb675de97b9b0743c09368820a770e2ceda05f8/core/src/main/java/org/apache/calcite/avatica/util/AbstractCursor.java#L162 > By default, it seems to be configured to store {{TIMESTAMP}} columns as > {{long}} values. If you run the SQL shell and select a {{TIMESTAMP}} column, > you get: > {code} > ava.lang.ClassCastException: org.joda.time.Instant cannot be cast to > java.lang.Number > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.util.AbstractCursor$NumberAccessor.getNumber(AbstractCursor.java:726) > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.util.AbstractCursor$TimestampFromNumberAccessor.getString(AbstractCursor.java:1026) > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.AvaticaResultSet.getString(AvaticaResultSet.java:225) > at sqlline.Rows$Row.(Rows.java:183) > {code} > So,
[jira] [Work logged] (BEAM-4700) JDBC driver cannot support TIMESTAMP data type
[ https://issues.apache.org/jira/browse/BEAM-4700?focusedWorklogId=124126=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-124126 ] ASF GitHub Bot logged work on BEAM-4700: Author: ASF GitHub Bot Created on: 17/Jul/18 16:23 Start Date: 17/Jul/18 16:23 Worklog Time Spent: 10m Work Description: kennknowles commented on issue #5919: [BEAM-4700] [SQL] Default timezone is UTC URL: https://github.com/apache/beam/pull/5919#issuecomment-405642599 Nice. I'll close out my issue against Calcite. I was waiting to see if there was an easy/obvious way to just set the default for us. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 124126) Time Spent: 2h 40m (was: 2.5h) > JDBC driver cannot support TIMESTAMP data type > -- > > Key: BEAM-4700 > URL: https://issues.apache.org/jira/browse/BEAM-4700 > Project: Beam > Issue Type: Bug > Components: dsl-sql >Reporter: Kenneth Knowles >Assignee: Andrew Pilloud >Priority: Major > Time Spent: 2h 40m > Remaining Estimate: 0h > > Avatica allows column representation to be customized, so a timestamp can be > stored as a variety of types. Joda ReadableInstant is none of these types: > https://github.com/apache/calcite-avatica/blob/acb675de97b9b0743c09368820a770e2ceda05f8/core/src/main/java/org/apache/calcite/avatica/util/AbstractCursor.java#L162 > By default, it seems to be configured to store {{TIMESTAMP}} columns as > {{long}} values. If you run the SQL shell and select a {{TIMESTAMP}} column, > you get: > {code} > ava.lang.ClassCastException: org.joda.time.Instant cannot be cast to > java.lang.Number > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.util.AbstractCursor$NumberAccessor.getNumber(AbstractCursor.java:726) > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.util.AbstractCursor$TimestampFromNumberAccessor.getString(AbstractCursor.java:1026) > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.AvaticaResultSet.getString(AvaticaResultSet.java:225) > at sqlline.Rows$Row.(Rows.java:183) > {code} > So, essentially, Beam SQL Shell does not support timestamps. > We may be able to: > - override how the accessor for our existing storage is created > - configure what the column representation is (this doesn't really help, > since none of the choices are ours) > - convert timestamps to longs in BeamEnumerableConverter; not sure how many > conversions will be required here -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-4700) JDBC driver cannot support TIMESTAMP data type
[ https://issues.apache.org/jira/browse/BEAM-4700?focusedWorklogId=123731=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-123731 ] ASF GitHub Bot logged work on BEAM-4700: Author: ASF GitHub Bot Created on: 16/Jul/18 19:09 Start Date: 16/Jul/18 19:09 Worklog Time Spent: 10m Work Description: apilloud commented on issue #5919: [BEAM-4700] [SQL] Default timezone is UTC URL: https://github.com/apache/beam/pull/5919#issuecomment-405349112 R: @reuvenlax Avatica tries to get fancy and convert everything to the local system timezone. This disables that behavior by default. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 123731) Time Spent: 2.5h (was: 2h 20m) > JDBC driver cannot support TIMESTAMP data type > -- > > Key: BEAM-4700 > URL: https://issues.apache.org/jira/browse/BEAM-4700 > Project: Beam > Issue Type: Bug > Components: dsl-sql >Reporter: Kenneth Knowles >Assignee: Andrew Pilloud >Priority: Major > Time Spent: 2.5h > Remaining Estimate: 0h > > Avatica allows column representation to be customized, so a timestamp can be > stored as a variety of types. Joda ReadableInstant is none of these types: > https://github.com/apache/calcite-avatica/blob/acb675de97b9b0743c09368820a770e2ceda05f8/core/src/main/java/org/apache/calcite/avatica/util/AbstractCursor.java#L162 > By default, it seems to be configured to store {{TIMESTAMP}} columns as > {{long}} values. If you run the SQL shell and select a {{TIMESTAMP}} column, > you get: > {code} > ava.lang.ClassCastException: org.joda.time.Instant cannot be cast to > java.lang.Number > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.util.AbstractCursor$NumberAccessor.getNumber(AbstractCursor.java:726) > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.util.AbstractCursor$TimestampFromNumberAccessor.getString(AbstractCursor.java:1026) > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.AvaticaResultSet.getString(AvaticaResultSet.java:225) > at sqlline.Rows$Row.(Rows.java:183) > {code} > So, essentially, Beam SQL Shell does not support timestamps. > We may be able to: > - override how the accessor for our existing storage is created > - configure what the column representation is (this doesn't really help, > since none of the choices are ours) > - convert timestamps to longs in BeamEnumerableConverter; not sure how many > conversions will be required here -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-4700) JDBC driver cannot support TIMESTAMP data type
[ https://issues.apache.org/jira/browse/BEAM-4700?focusedWorklogId=121695=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-121695 ] ASF GitHub Bot logged work on BEAM-4700: Author: ASF GitHub Bot Created on: 10/Jul/18 23:33 Start Date: 10/Jul/18 23:33 Worklog Time Spent: 10m Work Description: apilloud commented on issue #5919: BEAM-4700: [SQL] Default timezone is UTC URL: https://github.com/apache/beam/pull/5919#issuecomment-403998185 @lukecwik You like timezones. We made them not matter in Beam SQL by setting the default timezone to UTC instead of local time. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 121695) Time Spent: 2h 20m (was: 2h 10m) > JDBC driver cannot support TIMESTAMP data type > -- > > Key: BEAM-4700 > URL: https://issues.apache.org/jira/browse/BEAM-4700 > Project: Beam > Issue Type: Bug > Components: dsl-sql >Reporter: Kenneth Knowles >Assignee: Andrew Pilloud >Priority: Major > Time Spent: 2h 20m > Remaining Estimate: 0h > > Avatica allows column representation to be customized, so a timestamp can be > stored as a variety of types. Joda ReadableInstant is none of these types: > https://github.com/apache/calcite-avatica/blob/acb675de97b9b0743c09368820a770e2ceda05f8/core/src/main/java/org/apache/calcite/avatica/util/AbstractCursor.java#L162 > By default, it seems to be configured to store {{TIMESTAMP}} columns as > {{long}} values. If you run the SQL shell and select a {{TIMESTAMP}} column, > you get: > {code} > ava.lang.ClassCastException: org.joda.time.Instant cannot be cast to > java.lang.Number > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.util.AbstractCursor$NumberAccessor.getNumber(AbstractCursor.java:726) > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.util.AbstractCursor$TimestampFromNumberAccessor.getString(AbstractCursor.java:1026) > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.AvaticaResultSet.getString(AvaticaResultSet.java:225) > at sqlline.Rows$Row.(Rows.java:183) > {code} > So, essentially, Beam SQL Shell does not support timestamps. > We may be able to: > - override how the accessor for our existing storage is created > - configure what the column representation is (this doesn't really help, > since none of the choices are ours) > - convert timestamps to longs in BeamEnumerableConverter; not sure how many > conversions will be required here -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-4700) JDBC driver cannot support TIMESTAMP data type
[ https://issues.apache.org/jira/browse/BEAM-4700?focusedWorklogId=121694=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-121694 ] ASF GitHub Bot logged work on BEAM-4700: Author: ASF GitHub Bot Created on: 10/Jul/18 23:26 Start Date: 10/Jul/18 23:26 Worklog Time Spent: 10m Work Description: vectorijk commented on issue #5919: BEAM-4700: [SQL] Default timezone is UTC URL: https://github.com/apache/beam/pull/5919#issuecomment-403996976 LGTM This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 121694) Time Spent: 2h 10m (was: 2h) > JDBC driver cannot support TIMESTAMP data type > -- > > Key: BEAM-4700 > URL: https://issues.apache.org/jira/browse/BEAM-4700 > Project: Beam > Issue Type: Bug > Components: dsl-sql >Reporter: Kenneth Knowles >Assignee: Andrew Pilloud >Priority: Major > Time Spent: 2h 10m > Remaining Estimate: 0h > > Avatica allows column representation to be customized, so a timestamp can be > stored as a variety of types. Joda ReadableInstant is none of these types: > https://github.com/apache/calcite-avatica/blob/acb675de97b9b0743c09368820a770e2ceda05f8/core/src/main/java/org/apache/calcite/avatica/util/AbstractCursor.java#L162 > By default, it seems to be configured to store {{TIMESTAMP}} columns as > {{long}} values. If you run the SQL shell and select a {{TIMESTAMP}} column, > you get: > {code} > ava.lang.ClassCastException: org.joda.time.Instant cannot be cast to > java.lang.Number > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.util.AbstractCursor$NumberAccessor.getNumber(AbstractCursor.java:726) > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.util.AbstractCursor$TimestampFromNumberAccessor.getString(AbstractCursor.java:1026) > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.AvaticaResultSet.getString(AvaticaResultSet.java:225) > at sqlline.Rows$Row.(Rows.java:183) > {code} > So, essentially, Beam SQL Shell does not support timestamps. > We may be able to: > - override how the accessor for our existing storage is created > - configure what the column representation is (this doesn't really help, > since none of the choices are ours) > - convert timestamps to longs in BeamEnumerableConverter; not sure how many > conversions will be required here -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-4700) JDBC driver cannot support TIMESTAMP data type
[ https://issues.apache.org/jira/browse/BEAM-4700?focusedWorklogId=121673=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-121673 ] ASF GitHub Bot logged work on BEAM-4700: Author: ASF GitHub Bot Created on: 10/Jul/18 22:52 Start Date: 10/Jul/18 22:52 Worklog Time Spent: 10m Work Description: akedin commented on issue #5919: BEAM-4700: [SQL] Default timezone is UTC URL: https://github.com/apache/beam/pull/5919#issuecomment-403990888 LGTM This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 121673) Time Spent: 2h (was: 1h 50m) > JDBC driver cannot support TIMESTAMP data type > -- > > Key: BEAM-4700 > URL: https://issues.apache.org/jira/browse/BEAM-4700 > Project: Beam > Issue Type: Bug > Components: dsl-sql >Reporter: Kenneth Knowles >Assignee: Andrew Pilloud >Priority: Major > Time Spent: 2h > Remaining Estimate: 0h > > Avatica allows column representation to be customized, so a timestamp can be > stored as a variety of types. Joda ReadableInstant is none of these types: > https://github.com/apache/calcite-avatica/blob/acb675de97b9b0743c09368820a770e2ceda05f8/core/src/main/java/org/apache/calcite/avatica/util/AbstractCursor.java#L162 > By default, it seems to be configured to store {{TIMESTAMP}} columns as > {{long}} values. If you run the SQL shell and select a {{TIMESTAMP}} column, > you get: > {code} > ava.lang.ClassCastException: org.joda.time.Instant cannot be cast to > java.lang.Number > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.util.AbstractCursor$NumberAccessor.getNumber(AbstractCursor.java:726) > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.util.AbstractCursor$TimestampFromNumberAccessor.getString(AbstractCursor.java:1026) > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.AvaticaResultSet.getString(AvaticaResultSet.java:225) > at sqlline.Rows$Row.(Rows.java:183) > {code} > So, essentially, Beam SQL Shell does not support timestamps. > We may be able to: > - override how the accessor for our existing storage is created > - configure what the column representation is (this doesn't really help, > since none of the choices are ours) > - convert timestamps to longs in BeamEnumerableConverter; not sure how many > conversions will be required here -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-4700) JDBC driver cannot support TIMESTAMP data type
[ https://issues.apache.org/jira/browse/BEAM-4700?focusedWorklogId=121666=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-121666 ] ASF GitHub Bot logged work on BEAM-4700: Author: ASF GitHub Bot Created on: 10/Jul/18 22:37 Start Date: 10/Jul/18 22:37 Worklog Time Spent: 10m Work Description: apilloud commented on issue #5919: BEAM-4700: [SQL] Default timezone is UTC URL: https://github.com/apache/beam/pull/5919#issuecomment-403988096 run java postcommit This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 121666) Time Spent: 1h 50m (was: 1h 40m) > JDBC driver cannot support TIMESTAMP data type > -- > > Key: BEAM-4700 > URL: https://issues.apache.org/jira/browse/BEAM-4700 > Project: Beam > Issue Type: Bug > Components: dsl-sql >Reporter: Kenneth Knowles >Assignee: Andrew Pilloud >Priority: Major > Time Spent: 1h 50m > Remaining Estimate: 0h > > Avatica allows column representation to be customized, so a timestamp can be > stored as a variety of types. Joda ReadableInstant is none of these types: > https://github.com/apache/calcite-avatica/blob/acb675de97b9b0743c09368820a770e2ceda05f8/core/src/main/java/org/apache/calcite/avatica/util/AbstractCursor.java#L162 > By default, it seems to be configured to store {{TIMESTAMP}} columns as > {{long}} values. If you run the SQL shell and select a {{TIMESTAMP}} column, > you get: > {code} > ava.lang.ClassCastException: org.joda.time.Instant cannot be cast to > java.lang.Number > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.util.AbstractCursor$NumberAccessor.getNumber(AbstractCursor.java:726) > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.util.AbstractCursor$TimestampFromNumberAccessor.getString(AbstractCursor.java:1026) > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.AvaticaResultSet.getString(AvaticaResultSet.java:225) > at sqlline.Rows$Row.(Rows.java:183) > {code} > So, essentially, Beam SQL Shell does not support timestamps. > We may be able to: > - override how the accessor for our existing storage is created > - configure what the column representation is (this doesn't really help, > since none of the choices are ours) > - convert timestamps to longs in BeamEnumerableConverter; not sure how many > conversions will be required here -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-4700) JDBC driver cannot support TIMESTAMP data type
[ https://issues.apache.org/jira/browse/BEAM-4700?focusedWorklogId=121665=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-121665 ] ASF GitHub Bot logged work on BEAM-4700: Author: ASF GitHub Bot Created on: 10/Jul/18 22:35 Start Date: 10/Jul/18 22:35 Worklog Time Spent: 10m Work Description: amaliujia commented on issue #5919: BEAM-4700: [SQL] Default timezone is UTC URL: https://github.com/apache/beam/pull/5919#issuecomment-403987646 How about trigger the java post commit test as well so it can still pass SQL read/write tests? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 121665) Time Spent: 1h 40m (was: 1.5h) > JDBC driver cannot support TIMESTAMP data type > -- > > Key: BEAM-4700 > URL: https://issues.apache.org/jira/browse/BEAM-4700 > Project: Beam > Issue Type: Bug > Components: dsl-sql >Reporter: Kenneth Knowles >Assignee: Andrew Pilloud >Priority: Major > Time Spent: 1h 40m > Remaining Estimate: 0h > > Avatica allows column representation to be customized, so a timestamp can be > stored as a variety of types. Joda ReadableInstant is none of these types: > https://github.com/apache/calcite-avatica/blob/acb675de97b9b0743c09368820a770e2ceda05f8/core/src/main/java/org/apache/calcite/avatica/util/AbstractCursor.java#L162 > By default, it seems to be configured to store {{TIMESTAMP}} columns as > {{long}} values. If you run the SQL shell and select a {{TIMESTAMP}} column, > you get: > {code} > ava.lang.ClassCastException: org.joda.time.Instant cannot be cast to > java.lang.Number > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.util.AbstractCursor$NumberAccessor.getNumber(AbstractCursor.java:726) > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.util.AbstractCursor$TimestampFromNumberAccessor.getString(AbstractCursor.java:1026) > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.AvaticaResultSet.getString(AvaticaResultSet.java:225) > at sqlline.Rows$Row.(Rows.java:183) > {code} > So, essentially, Beam SQL Shell does not support timestamps. > We may be able to: > - override how the accessor for our existing storage is created > - configure what the column representation is (this doesn't really help, > since none of the choices are ours) > - convert timestamps to longs in BeamEnumerableConverter; not sure how many > conversions will be required here -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-4700) JDBC driver cannot support TIMESTAMP data type
[ https://issues.apache.org/jira/browse/BEAM-4700?focusedWorklogId=121664=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-121664 ] ASF GitHub Bot logged work on BEAM-4700: Author: ASF GitHub Bot Created on: 10/Jul/18 22:34 Start Date: 10/Jul/18 22:34 Worklog Time Spent: 10m Work Description: amaliujia commented on issue #5919: BEAM-4700: [SQL] Default timezone is UTC URL: https://github.com/apache/beam/pull/5919#issuecomment-403987426 LGTM This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 121664) Time Spent: 1.5h (was: 1h 20m) > JDBC driver cannot support TIMESTAMP data type > -- > > Key: BEAM-4700 > URL: https://issues.apache.org/jira/browse/BEAM-4700 > Project: Beam > Issue Type: Bug > Components: dsl-sql >Reporter: Kenneth Knowles >Assignee: Andrew Pilloud >Priority: Major > Time Spent: 1.5h > Remaining Estimate: 0h > > Avatica allows column representation to be customized, so a timestamp can be > stored as a variety of types. Joda ReadableInstant is none of these types: > https://github.com/apache/calcite-avatica/blob/acb675de97b9b0743c09368820a770e2ceda05f8/core/src/main/java/org/apache/calcite/avatica/util/AbstractCursor.java#L162 > By default, it seems to be configured to store {{TIMESTAMP}} columns as > {{long}} values. If you run the SQL shell and select a {{TIMESTAMP}} column, > you get: > {code} > ava.lang.ClassCastException: org.joda.time.Instant cannot be cast to > java.lang.Number > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.util.AbstractCursor$NumberAccessor.getNumber(AbstractCursor.java:726) > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.util.AbstractCursor$TimestampFromNumberAccessor.getString(AbstractCursor.java:1026) > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.AvaticaResultSet.getString(AvaticaResultSet.java:225) > at sqlline.Rows$Row.(Rows.java:183) > {code} > So, essentially, Beam SQL Shell does not support timestamps. > We may be able to: > - override how the accessor for our existing storage is created > - configure what the column representation is (this doesn't really help, > since none of the choices are ours) > - convert timestamps to longs in BeamEnumerableConverter; not sure how many > conversions will be required here -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-4700) JDBC driver cannot support TIMESTAMP data type
[ https://issues.apache.org/jira/browse/BEAM-4700?focusedWorklogId=121662=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-121662 ] ASF GitHub Bot logged work on BEAM-4700: Author: ASF GitHub Bot Created on: 10/Jul/18 22:29 Start Date: 10/Jul/18 22:29 Worklog Time Spent: 10m Work Description: apilloud commented on issue #5919: BEAM-4700: [SQL] Default timezone is UTC URL: https://github.com/apache/beam/pull/5919#issuecomment-403986452 R: @akedin cc: @amaliujia This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 121662) Time Spent: 1h 20m (was: 1h 10m) > JDBC driver cannot support TIMESTAMP data type > -- > > Key: BEAM-4700 > URL: https://issues.apache.org/jira/browse/BEAM-4700 > Project: Beam > Issue Type: Bug > Components: dsl-sql >Reporter: Kenneth Knowles >Assignee: Andrew Pilloud >Priority: Major > Time Spent: 1h 20m > Remaining Estimate: 0h > > Avatica allows column representation to be customized, so a timestamp can be > stored as a variety of types. Joda ReadableInstant is none of these types: > https://github.com/apache/calcite-avatica/blob/acb675de97b9b0743c09368820a770e2ceda05f8/core/src/main/java/org/apache/calcite/avatica/util/AbstractCursor.java#L162 > By default, it seems to be configured to store {{TIMESTAMP}} columns as > {{long}} values. If you run the SQL shell and select a {{TIMESTAMP}} column, > you get: > {code} > ava.lang.ClassCastException: org.joda.time.Instant cannot be cast to > java.lang.Number > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.util.AbstractCursor$NumberAccessor.getNumber(AbstractCursor.java:726) > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.util.AbstractCursor$TimestampFromNumberAccessor.getString(AbstractCursor.java:1026) > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.AvaticaResultSet.getString(AvaticaResultSet.java:225) > at sqlline.Rows$Row.(Rows.java:183) > {code} > So, essentially, Beam SQL Shell does not support timestamps. > We may be able to: > - override how the accessor for our existing storage is created > - configure what the column representation is (this doesn't really help, > since none of the choices are ours) > - convert timestamps to longs in BeamEnumerableConverter; not sure how many > conversions will be required here -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-4700) JDBC driver cannot support TIMESTAMP data type
[ https://issues.apache.org/jira/browse/BEAM-4700?focusedWorklogId=121643=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-121643 ] ASF GitHub Bot logged work on BEAM-4700: Author: ASF GitHub Bot Created on: 10/Jul/18 21:57 Start Date: 10/Jul/18 21:57 Worklog Time Spent: 10m Work Description: apilloud opened a new pull request #5919: BEAM-4700: [SQL] Default timezone is UTC URL: https://github.com/apache/beam/pull/5919 This fixes JDBC timezone conversion issues. Follow this checklist to help us incorporate your contribution quickly and easily: - [X] Format the pull request title like `[BEAM-XXX] Fixes bug in ApproximateQuantiles`, where you replace `BEAM-XXX` with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue. - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). It will help us expedite review of your Pull Request if you tag someone (e.g. `@username`) to look at it. Post-Commit Tests Status (on master branch) Lang | SDK | Apex | Dataflow | Flink | Gearpump | Samza | Spark --- | --- | --- | --- | --- | --- | --- | --- Go | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Go_GradleBuild/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Go_GradleBuild/lastCompletedBuild/) | --- | --- | --- | --- | --- | --- Java | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_GradleBuild/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_GradleBuild/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Apex_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Apex_Gradle/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow_Gradle/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink_Gradle/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Gearpump_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Gearpump_Gradle/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Samza_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Samza_Gradle/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark_Gradle/lastCompletedBuild/) Python | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Python_Verify/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Python_Verify/lastCompletedBuild/) | --- | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Py_VR_Dataflow/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Py_VR_Dataflow/lastCompletedBuild/) [![Build Status](https://builds.apache.org/job/beam_PostCommit_Py_ValCont/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Py_ValCont/lastCompletedBuild/) | --- | --- | --- | --- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 121643) Time Spent: 1h 10m (was: 1h) > JDBC driver cannot support TIMESTAMP data type > -- > > Key: BEAM-4700 > URL: https://issues.apache.org/jira/browse/BEAM-4700 > Project: Beam > Issue Type: Bug > Components: dsl-sql >Reporter: Kenneth Knowles >Assignee: Andrew Pilloud >Priority: Major > Time Spent: 1h 10m > Remaining Estimate: 0h > > Avatica allows column representation to be customized, so a timestamp can be > stored as a variety of types. Joda
[jira] [Work logged] (BEAM-4700) JDBC driver cannot support TIMESTAMP data type
[ https://issues.apache.org/jira/browse/BEAM-4700?focusedWorklogId=117972=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-117972 ] ASF GitHub Bot logged work on BEAM-4700: Author: ASF GitHub Bot Created on: 01/Jul/18 14:00 Start Date: 01/Jul/18 14:00 Worklog Time Spent: 10m Work Description: kennknowles commented on issue #5849: [BEAM-4700] Convert Beam Row to Avatica Row in BeamEnumerableCollector URL: https://github.com/apache/beam/pull/5849#issuecomment-401608879 https://issues.apache.org/jira/browse/BEAM-4701 for that This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 117972) Time Spent: 1h (was: 50m) > JDBC driver cannot support TIMESTAMP data type > -- > > Key: BEAM-4700 > URL: https://issues.apache.org/jira/browse/BEAM-4700 > Project: Beam > Issue Type: Bug > Components: dsl-sql >Reporter: Kenneth Knowles >Assignee: Kenneth Knowles >Priority: Blocker > Time Spent: 1h > Remaining Estimate: 0h > > Avatica allows column representation to be customized, so a timestamp can be > stored as a variety of types. Joda ReadableInstant is none of these types: > https://github.com/apache/calcite-avatica/blob/acb675de97b9b0743c09368820a770e2ceda05f8/core/src/main/java/org/apache/calcite/avatica/util/AbstractCursor.java#L162 > By default, it seems to be configured to store {{TIMESTAMP}} columns as > {{long}} values. If you run the SQL shell and select a {{TIMESTAMP}} column, > you get: > {code} > ava.lang.ClassCastException: org.joda.time.Instant cannot be cast to > java.lang.Number > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.util.AbstractCursor$NumberAccessor.getNumber(AbstractCursor.java:726) > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.util.AbstractCursor$TimestampFromNumberAccessor.getString(AbstractCursor.java:1026) > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.AvaticaResultSet.getString(AvaticaResultSet.java:225) > at sqlline.Rows$Row.(Rows.java:183) > {code} > So, essentially, Beam SQL Shell does not support timestamps. > We may be able to: > - override how the accessor for our existing storage is created > - configure what the column representation is (this doesn't really help, > since none of the choices are ours) > - convert timestamps to longs in BeamEnumerableConverter; not sure how many > conversions will be required here -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-4700) JDBC driver cannot support TIMESTAMP data type
[ https://issues.apache.org/jira/browse/BEAM-4700?focusedWorklogId=117971=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-117971 ] ASF GitHub Bot logged work on BEAM-4700: Author: ASF GitHub Bot Created on: 01/Jul/18 13:58 Start Date: 01/Jul/18 13:58 Worklog Time Spent: 10m Work Description: kennknowles closed pull request #5849: [BEAM-4700] Convert Beam Row to Avatica Row in BeamEnumerableCollector URL: https://github.com/apache/beam/pull/5849 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/rel/BeamEnumerableConverter.java b/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/rel/BeamEnumerableConverter.java index 015e8711753..0924542e52c 100644 --- a/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/rel/BeamEnumerableConverter.java +++ b/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/rel/BeamEnumerableConverter.java @@ -26,6 +26,7 @@ import java.util.Queue; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.stream.Collectors; import javax.annotation.Nullable; import org.apache.beam.runners.direct.DirectOptions; import org.apache.beam.sdk.Pipeline; @@ -42,6 +43,7 @@ import org.apache.beam.sdk.options.PipelineOptions; import org.apache.beam.sdk.options.PipelineOptionsFactory; import org.apache.beam.sdk.runners.TransformHierarchy.Node; +import org.apache.beam.sdk.schemas.Schema; import org.apache.beam.sdk.state.StateSpec; import org.apache.beam.sdk.state.StateSpecs; import org.apache.beam.sdk.state.ValueState; @@ -71,6 +73,7 @@ import org.apache.calcite.rel.metadata.RelMetadataQuery; import org.apache.calcite.rel.type.RelDataType; import org.joda.time.Duration; +import org.joda.time.ReadableInstant; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -160,14 +163,12 @@ public boolean isReached() { private static PipelineResult limitRun( PipelineOptions options, BeamRelNode node, - DoFn> collectDoFn, DoFn, Void> limitCounterDoFn, LimitStateVar limitStateVar) { options.as(DirectOptions.class).setBlockOnRun(false); Pipeline pipeline = Pipeline.create(options); -BeamSqlRelUtils.toPCollection(pipeline, node) -.apply(ParDo.of(collectDoFn)) -.apply(ParDo.of(limitCounterDoFn)); +PCollection resultCollection = BeamSqlRelUtils.toPCollection(pipeline, node); +resultCollection.apply(ParDo.of(new LimitCollector())).apply(ParDo.of(limitCounterDoFn)); PipelineResult result = pipeline.run(); @@ -207,7 +208,8 @@ private static PipelineResult limitRun( Collector.globalValues.put(id, values); Pipeline pipeline = Pipeline.create(options); -BeamSqlRelUtils.toPCollection(pipeline, node).apply(ParDo.of(new Collector())); +PCollection resultCollection = BeamSqlRelUtils.toPCollection(pipeline, node); +resultCollection.apply(ParDo.of(new Collector())); PipelineResult result = pipeline.run(); result.waitUntilFinish(); @@ -233,7 +235,7 @@ private static PipelineResult limitRun( LimitCanceller.globalLimitArguments.put(id, limitCount); LimitCanceller.globalStates.put(id, limitStateVar); LimitCollector.globalValues.put(id, values); -limitRun(options, node, new LimitCollector(), new LimitCanceller(), limitStateVar); +limitRun(options, node, new LimitCanceller(), limitStateVar); LimitCanceller.globalLimitArguments.remove(id); LimitCanceller.globalStates.remove(id); LimitCollector.globalValues.remove(id); @@ -276,6 +278,7 @@ public void processElement( } private static class LimitCollector extends DoFn> { + // This will only work on the direct runner. private static final Map> globalValues = new ConcurrentHashMap>(); @@ -290,17 +293,18 @@ public void startBundle(StartBundleContext context) { @ProcessElement public void processElement(ProcessContext context) { - Object[] input = context.element().getValues().toArray(); - if (input.length == 1) { -values.add(input[0]); + Object[] avaticaRow = rowToAvatica(context.element()); + if (avaticaRow.length == 1) { +values.add(avaticaRow[0]); } else { -values.add(input); +values.add(avaticaRow); } context.output(KV.of("DummyKey", context.element())); } } private static class Collector extends DoFn { + // This will only work on the direct runner. private static final Map> globalValues =
[jira] [Work logged] (BEAM-4700) JDBC driver cannot support TIMESTAMP data type
[ https://issues.apache.org/jira/browse/BEAM-4700?focusedWorklogId=117970=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-117970 ] ASF GitHub Bot logged work on BEAM-4700: Author: ASF GitHub Bot Created on: 01/Jul/18 13:58 Start Date: 01/Jul/18 13:58 Worklog Time Spent: 10m Work Description: kennknowles commented on issue #5849: [BEAM-4700] Convert Beam Row to Avatica Row in BeamEnumerableCollector URL: https://github.com/apache/beam/pull/5849#issuecomment-401608662 Yes, I'm pondering how to do this. I would like to get the DSL-level tests to run both as a PTransform and also through JDBC driver. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 117970) Time Spent: 40m (was: 0.5h) > JDBC driver cannot support TIMESTAMP data type > -- > > Key: BEAM-4700 > URL: https://issues.apache.org/jira/browse/BEAM-4700 > Project: Beam > Issue Type: Bug > Components: dsl-sql >Reporter: Kenneth Knowles >Assignee: Kenneth Knowles >Priority: Blocker > Time Spent: 40m > Remaining Estimate: 0h > > Avatica allows column representation to be customized, so a timestamp can be > stored as a variety of types. Joda ReadableInstant is none of these types: > https://github.com/apache/calcite-avatica/blob/acb675de97b9b0743c09368820a770e2ceda05f8/core/src/main/java/org/apache/calcite/avatica/util/AbstractCursor.java#L162 > By default, it seems to be configured to store {{TIMESTAMP}} columns as > {{long}} values. If you run the SQL shell and select a {{TIMESTAMP}} column, > you get: > {code} > ava.lang.ClassCastException: org.joda.time.Instant cannot be cast to > java.lang.Number > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.util.AbstractCursor$NumberAccessor.getNumber(AbstractCursor.java:726) > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.util.AbstractCursor$TimestampFromNumberAccessor.getString(AbstractCursor.java:1026) > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.AvaticaResultSet.getString(AvaticaResultSet.java:225) > at sqlline.Rows$Row.(Rows.java:183) > {code} > So, essentially, Beam SQL Shell does not support timestamps. > We may be able to: > - override how the accessor for our existing storage is created > - configure what the column representation is (this doesn't really help, > since none of the choices are ours) > - convert timestamps to longs in BeamEnumerableConverter; not sure how many > conversions will be required here -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-4700) JDBC driver cannot support TIMESTAMP data type
[ https://issues.apache.org/jira/browse/BEAM-4700?focusedWorklogId=117939=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-117939 ] ASF GitHub Bot logged work on BEAM-4700: Author: ASF GitHub Bot Created on: 01/Jul/18 04:45 Start Date: 01/Jul/18 04:45 Worklog Time Spent: 10m Work Description: apilloud commented on issue #5849: [BEAM-4700] Convert Beam Row to Avatica Row in BeamEnumerableCollector URL: https://github.com/apache/beam/pull/5849#issuecomment-401582729 LGTM. Are there tests we should write? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 117939) Time Spent: 0.5h (was: 20m) > JDBC driver cannot support TIMESTAMP data type > -- > > Key: BEAM-4700 > URL: https://issues.apache.org/jira/browse/BEAM-4700 > Project: Beam > Issue Type: Bug > Components: dsl-sql >Reporter: Kenneth Knowles >Assignee: Kenneth Knowles >Priority: Blocker > Time Spent: 0.5h > Remaining Estimate: 0h > > Avatica allows column representation to be customized, so a timestamp can be > stored as a variety of types. Joda ReadableInstant is none of these types: > https://github.com/apache/calcite-avatica/blob/acb675de97b9b0743c09368820a770e2ceda05f8/core/src/main/java/org/apache/calcite/avatica/util/AbstractCursor.java#L162 > By default, it seems to be configured to store {{TIMESTAMP}} columns as > {{long}} values. If you run the SQL shell and select a {{TIMESTAMP}} column, > you get: > {code} > ava.lang.ClassCastException: org.joda.time.Instant cannot be cast to > java.lang.Number > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.util.AbstractCursor$NumberAccessor.getNumber(AbstractCursor.java:726) > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.util.AbstractCursor$TimestampFromNumberAccessor.getString(AbstractCursor.java:1026) > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.AvaticaResultSet.getString(AvaticaResultSet.java:225) > at sqlline.Rows$Row.(Rows.java:183) > {code} > So, essentially, Beam SQL Shell does not support timestamps. > We may be able to: > - override how the accessor for our existing storage is created > - configure what the column representation is (this doesn't really help, > since none of the choices are ours) > - convert timestamps to longs in BeamEnumerableConverter; not sure how many > conversions will be required here -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-4700) JDBC driver cannot support TIMESTAMP data type
[ https://issues.apache.org/jira/browse/BEAM-4700?focusedWorklogId=117936=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-117936 ] ASF GitHub Bot logged work on BEAM-4700: Author: ASF GitHub Bot Created on: 01/Jul/18 03:40 Start Date: 01/Jul/18 03:40 Worklog Time Spent: 10m Work Description: kennknowles commented on issue #5849: [BEAM-4700] Convert Beam Row to Avatica Row in BeamEnumerableCollector URL: https://github.com/apache/beam/pull/5849#issuecomment-401580944 R: @apilloud @amaliujia This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 117936) Time Spent: 20m (was: 10m) > JDBC driver cannot support TIMESTAMP data type > -- > > Key: BEAM-4700 > URL: https://issues.apache.org/jira/browse/BEAM-4700 > Project: Beam > Issue Type: Bug > Components: dsl-sql >Reporter: Kenneth Knowles >Assignee: Kenneth Knowles >Priority: Blocker > Time Spent: 20m > Remaining Estimate: 0h > > Avatica allows column representation to be customized, so a timestamp can be > stored as a variety of types. Joda ReadableInstant is none of these types: > https://github.com/apache/calcite-avatica/blob/acb675de97b9b0743c09368820a770e2ceda05f8/core/src/main/java/org/apache/calcite/avatica/util/AbstractCursor.java#L162 > By default, it seems to be configured to store {{TIMESTAMP}} columns as > {{long}} values. If you run the SQL shell and select a {{TIMESTAMP}} column, > you get: > {code} > ava.lang.ClassCastException: org.joda.time.Instant cannot be cast to > java.lang.Number > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.util.AbstractCursor$NumberAccessor.getNumber(AbstractCursor.java:726) > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.util.AbstractCursor$TimestampFromNumberAccessor.getString(AbstractCursor.java:1026) > at > org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.avatica.AvaticaResultSet.getString(AvaticaResultSet.java:225) > at sqlline.Rows$Row.(Rows.java:183) > {code} > So, essentially, Beam SQL Shell does not support timestamps. > We may be able to: > - override how the accessor for our existing storage is created > - configure what the column representation is (this doesn't really help, > since none of the choices are ours) > - convert timestamps to longs in BeamEnumerableConverter; not sure how many > conversions will be required here -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-4700) JDBC driver cannot support TIMESTAMP data type
[ https://issues.apache.org/jira/browse/BEAM-4700?focusedWorklogId=117935=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-117935 ] ASF GitHub Bot logged work on BEAM-4700: Author: ASF GitHub Bot Created on: 01/Jul/18 03:39 Start Date: 01/Jul/18 03:39 Worklog Time Spent: 10m Work Description: kennknowles opened a new pull request #5849: [BEAM-4700] Convert Beam Row to Avatica Row in BeamEnumerableCollector URL: https://github.com/apache/beam/pull/5849 This is a fairly surgical fix that makes timestamps work. It is not at all a comprehensive solution to the general problem of establishing a proper compatibility between Beam `Row` and Avatica's meta schema stuff. I suspect we can override `Cursor.getAccessors` at the right place to avoid conversion at all. Since there's no meaningful documentation, it will take a minute to figure that out. Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Format the pull request title like `[BEAM-XXX] Fixes bug in ApproximateQuantiles`, where you replace `BEAM-XXX` with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue. - [x] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). It will help us expedite review of your Pull Request if you tag someone (e.g. `@username`) to look at it. Post-Commit Tests Status (on master branch) Lang | SDK | Apex | Dataflow | Flink | Gearpump | Samza | Spark --- | --- | --- | --- | --- | --- | --- | --- Go | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Go_GradleBuild/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Go_GradleBuild/lastCompletedBuild/) | --- | --- | --- | --- | --- | --- Java | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_GradleBuild/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_GradleBuild/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Apex_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Apex_Gradle/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow_Gradle/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink_Gradle/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Gearpump_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Gearpump_Gradle/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Samza_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Samza_Gradle/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark_Gradle/lastCompletedBuild/) Python | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Python_Verify/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Python_Verify/lastCompletedBuild/) | --- | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Py_VR_Dataflow/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Py_VR_Dataflow/lastCompletedBuild/) [![Build Status](https://builds.apache.org/job/beam_PostCommit_Py_ValCont/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Py_ValCont/lastCompletedBuild/) | --- | --- | --- | --- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 117935) Time Spent: 10m Remaining Estimate: 0h > JDBC driver cannot support TIMESTAMP data type > -- > > Key: BEAM-4700 >