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

Throw unsupported error message for || operator early in the parsing stage

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.7.0
    • 0.9.0
    • SQL Parser
    • None

    Description

      If we don't plan to support concat operator (||), we should throw a decent error message early.

      The error is cryptic:

      0: jdbc:drill:schema=dfs> select cast(l_orderkey as varchar(10)) || '-' || cast(l_partkey as varchar(10)) from cp.`tpch/lineitem.parquet`;
      Query failed: Query stopped., Line 65, Column 29: "value" is neither a method, a field, nor a member class of "org.apache.drill.exec.expr.holders.VarCharHolder" [ bc85685d-e08a-494b-aa9f-5b3fa4ee4033 on atsqa4-133.qa.lab:3
      1010 ]
      Error: exception while executing query: Failure while executing query. (state=,code=0)

      I believe that error that I'm getting from the query below is the result of not throwing "Unsupported" message earlier.
      Please correct me if I'm wrong.

      0: jdbc:drill:schema=dfs> select
      . . . . . . . . . . . . > cast(l_orderkey as varchar(10)) || '-' || cast(l_partkey as varchar(10))
      . . . . . . . . . . . . > from
      . . . . . . . . . . . . > (
      . . . . . . . . . . . . > select sum(l_quantity),
      . . . . . . . . . . . . > l_orderkey,
      . . . . . . . . . . . . > l_partkey
      . . . . . . . . . . . . > from cp.`tpch/lineitem.parquet`
      . . . . . . . . . . . . > group by
      . . . . . . . . . . . . > l_orderkey,
      . . . . . . . . . . . . > l_partkey
      . . . . . . . . . . . . > )
      . . . . . . . . . . . . > group by
      . . . . . . . . . . . . > cast(l_orderkey as varchar(10)) || '-' || cast(l_partkey as varchar(10));
      Query failed: Query failed: Failure while running fragment., You tried to do a batch data read operation when you were in a state of STOP. You can only do this type of operation when you are in a state of OK or OK_NEW_SCHEMA. [ f5cb68a8-7c05-4e02-a104-56081e6d34ce on atsqa4-133.qa.lab:31010 ]
      [ f5cb68a8-7c05-4e02-a104-56081e6d34ce on atsqa4-133.qa.lab:31010 ]

      Attachments

        1. DRILL-1877.6.patch
          19 kB
          Sean Hsuan-Yi Chu
        2. DRILL-1877.5.patch
          19 kB
          Sean Hsuan-Yi Chu
        3. DRILL-1877.4.patch
          13 kB
          Sean Hsuan-Yi Chu
        4. DRILL-1877.3.patch
          15 kB
          Sean Hsuan-Yi Chu
        5. DRILL-1877.2.patch
          3 kB
          Sean Hsuan-Yi Chu
        6. DRILL-1877.1.patch
          2 kB
          Sean Hsuan-Yi Chu

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: