Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-2115

Disable function CARDINALITY in grammar

    XMLWordPrintableJSON

Details

    Description

      Since we don't support multiset type, we should disable CARDINALITY function as well:

      0: jdbc:drill:schema=dfs> select cardinality(list) from `test.json`;
      Query failed: Query stopped., Failure while trying to materialize incoming schema.  Errors:
       
      Error in expression at index -1.  Error: Missing function implementation: [cardinality(BIGINT-REPEATED)].  Full expression: --UNKNOWN EXPRESSION--.. [ db86cf79-6083-4ad7-afa1-fac534b942bc on atsqa4-134.qa.lab:31010 ]
      
      
      Error: exception while executing query: Failure while executing query. (state=,code=0)
      0: jdbc:drill:schema=dfs> select cardinality(id) from `test.json`;
      Query failed: Query stopped., Failure while trying to materialize incoming schema.  Errors:
       
      Error in expression at index -1.  Error: Missing function implementation: [cardinality(BIGINT-OPTIONAL)].  Full expression: --UNKNOWN EXPRESSION--.. [ 1f209cb2-4d60-4c1d-b1d0-d921f8e8a913 on atsqa4-134.qa.lab:31010 ]
      
      
      Error: exception while executing query: Failure while executing query. (state=,code=0)
      0: jdbc:drill:schema=dfs> select cardinality() from `test.json`;
      Query failed: SqlValidatorException: Invalid number of arguments to function 'CARDINALITY'. Was expecting 1 arguments
      
      Error: exception while executing query: Failure while executing query. (state=,code=0)
      0: jdbc:drill:schema=dfs> select cardinality('aa') from `test.json`;
      Query failed: SqlValidatorException: Cannot apply 'CARDINALITY' to arguments of type 'CARDINALITY(<CHAR(2)>)'. Supported form(s): 'CARDINALITY(<MULTISET>)'
      'CARDINALITY(<ARRAY>)'
      'CARDINALITY(<MAP>)'
      
      Error: exception while executing query: Failure while executing query. (state=,code=0)
      

      Attachments

        Issue Links

          Activity

            People

              seanhychu Sean Hsuan-Yi Chu
              vicky Victoria Markman
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: