Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-4301

Unit tests for Cassandra adapter are wrongly applying ITEM operator to STRUCT columns

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      The following unit tests included in "cassandra/src/test/java/org/apache/calcite/test/CassandraAdapterDataTypesTest.java" are wrong, as they apply ITEM operator to a struct column _f_tuple_, instead of the DOT operator. 

      @Test void testCollectionsInnerRowType() {
        CalciteAssert.that()
            .with(DTCASSANDRA)
            .query("select \"f_list\"[1], "
                + "\"f_map\"['k1'], "
                + "\"f_tuple\"['1'], "
                + "\"f_tuple\"['2'], "
                + "\"f_tuple\"['3']"
                + " from \"test_collections\"")
            .typeIs("[EXPR$0 INTEGER"
                + ", EXPR$1 VARCHAR"
                + ", EXPR$2 BIGINT"
                + ", EXPR$3 VARBINARY"
                + ", EXPR$4 TIMESTAMP]");
      }
      
      @Test void testCollectionsInnerValues() {
             CalciteAssert.that()
                 .with(DTCASSANDRA)
                 .query("select \"f_list\"[1], "
                     + "\"f_map\"['k1'], "
                     + "\"f_tuple\"['1'], "
                     + "\"f_tuple\"['2'], "
                     + "\"f_tuple\"['3']"
                     + " from \"test_collections\"")
                 .returns("EXPR$0=1"
                     + "; EXPR$1=v1"
                     + "; EXPR$2=3000000000"
                     + "; EXPR$3=30ff87"
                     + "; EXPR$4=2015-05-03 13:30:54.234");
      }

       

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            asolimando Alessandro Solimando
            asolimando Alessandro Solimando
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 0.5h
                0.5h

                Slack

                  Issue deployment