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

[CALCITE-4600] ClassCastException for arrays with date/time/timestamp elements #154

Closed
wants to merge 6 commits into from

Conversation

asolimando
Copy link
Member

Rebasing https://github.com/apache/calcite-avatica/pulls on master and fixing conflicts.

The original PR includes commits for both [CALCITE-4600] and [CALCITE-4602].

While fixing conflicts I found out that merged PRs for [CALCITE-4536] and [CALCITE-4757] added tests but did not enable them, so I have added two extra commits to enable them (I think it's needed since they are already merged and that code is untested at the moment).

PS: whenever a new data type is added to @Override public ExecuteResult prepareAndExecute(, it must be paired with an addition under public static Collection<AccessorTestHelper> data(), otherwise it won't be called.

PPS: I suggested to the committer to squash the first two commits starting with [CALCITE-4600] (I did not do it because it was like this in the original PR, it's easier to check what I changed) and leave the rest as separate commits for clarity.

@julianhyde
Copy link
Contributor

Thanks for doing this. I just ran your top commit and I got a couple of failures:

FAILURE   0.0sec, org.apache.calcite.avatica.AvaticaResultSetConversionsTest > testGetArray[30: org.apache.calcite.avatica.AvaticaResultSetConversionsTest$DateArrayAccessorTestHelper@164f5eb0]
    java.lang.AssertionError
        at org.junit.Assert.fail(Assert.java:86)
        at org.junit.Assert.assertTrue(Assert.java:41)
        at org.junit.Assert.assertTrue(Assert.java:52)
        at org.apache.calcite.avatica.AvaticaResultSetConversionsTest$DateArrayAccessorTestHelper.testGetArray(AvaticaResultSetConversionsTest.java:639)
        at org.apache.calcite.avatica.AvaticaResultSetConversionsTest.testGetArray(AvaticaResultSetConversionsTest.java:1282)


org.apache.calcite.avatica.AvaticaResultSetConversionsTest > testGetArray[30: org.apache.calcite.avatica.AvaticaResultSetConversionsTest$DateArrayAccessorTestHelper@164f5eb0] FAILED
    java.lang.AssertionError
        at org.junit.Assert.fail(Assert.java:86)
        at org.junit.Assert.assertTrue(Assert.java:41)
        at org.junit.Assert.assertTrue(Assert.java:52)
        at org.apache.calcite.avatica.AvaticaResultSetConversionsTest$DateArrayAccessorTestHelper.testGetArray(AvaticaResultSetConversionsTest.java:639)
        at org.apache.calcite.avatica.AvaticaResultSetConversionsTest.testGetArray(AvaticaResultSetConversionsTest.java:1282)
FAILURE   0.0sec, org.apache.calcite.avatica.AvaticaResultSetConversionsTest > testGetArray[31: org.apache.calcite.avatica.AvaticaResultSetConversionsTest$DateArrayAccessorTestHelper@705513b4]
    java.lang.AssertionError
        at org.junit.Assert.fail(Assert.java:86)
        at org.junit.Assert.assertTrue(Assert.java:41)
        at org.junit.Assert.assertTrue(Assert.java:52)
        at org.apache.calcite.avatica.AvaticaResultSetConversionsTest$DateArrayAccessorTestHelper.testGetArray(AvaticaResultSetConversionsTest.java:639)
        at org.apache.calcite.avatica.AvaticaResultSetConversionsTest.testGetArray(AvaticaResultSetConversionsTest.java:1282)


org.apache.calcite.avatica.AvaticaResultSetConversionsTest > testGetArray[31: org.apache.calcite.avatica.AvaticaResultSetConversionsTest$DateArrayAccessorTestHelper@705513b4] FAILED
    java.lang.AssertionError
        at org.junit.Assert.fail(Assert.java:86)
        at org.junit.Assert.assertTrue(Assert.java:41)
        at org.junit.Assert.assertTrue(Assert.java:52)
        at org.apache.calcite.avatica.AvaticaResultSetConversionsTest$DateArrayAccessorTestHelper.testGetArray(AvaticaResultSetConversionsTest.java:639)
        at org.apache.calcite.avatica.AvaticaResultSetConversionsTest.testGetArray(AvaticaResultSetConversionsTest.java:1282)
FAILURE   0.6sec, 1026 completed,   2 failed,   0 skipped, org.apache.calcite.avatica.AvaticaResultSetConversionsTest
          0.5sec,   45 completed,   0 failed,   0 skipped, org.apache.calcite.avatica.AvaticaClosedStatementTest

Let's figure this out, and I'll merge.

@asolimando
Copy link
Member Author

I can't reproduce the failure locally on MacOSX (I have tried few JVMs), and it seems to work fine in CI.

I made sure to skip test cache which sometimes fools me by running with: ./gradlew --no-build-cache cleanTest test.

Could you share the relevant details of your environment so I can try to reproduce the issue?

Could you try if the failure happens with the original PR as well?

Thanks!

@snuyanzin
Copy link
Contributor

I created a PR to this branch with a fix for a problem in different timezone
asolimando@d15ad09

@asolimando
Copy link
Member Author

Thanks @snuyanzin, I have tested it locally with different timezones and it works fine.

@julianhyde
Copy link
Contributor

I'll merge shortly.

@julianhyde julianhyde closed this in 820edf6 Oct 3, 2021
@asolimando asolimando deleted the CALCITE-4600 branch October 4, 2021 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants