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

mondrian query - sql parser error: SqlValidatorException:[ Column 'fullname' is ambiguous ]"

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Invalid
    • Affects Version/s: None
    • Fix Version/s: 0.4.0
    • Component/s: SQL Parser
    • Labels:
      None

      Description

      #Mon Jul 14 10:10:52 PDT 2014
      git.commit.id.abbrev=699851b

      The following mondrian query (query12.q) failed sql parser:

      0: jdbc:drill:schema=dfs> select customer.country as c0, customer.state_province as c1, customer.city as c2, customer.customer_id as c3, fullname as c4, fullname as c5, customer.gender as c6, customer.marital_status as c7, customer.education as c8, customer.yearly_income as c9 from customer as customer, sales_fact_1997 as sales_fact_1997, time_by_day as time_by_day where sales_fact_1997.customer_id = customer.customer_id and sales_fact_1997.time_id = time_by_day.time_id and time_by_day.the_year = 1997 group by customer.country, customer.state_province, customer.city, customer.customer_id, fullname, customer.gender, customer.marital_status, customer.education, customer.yearly_income having fullname LIKE '%Jeanne%' order by customer.country ASC NULLS LAST, customer.state_province ASC NULLS LAST, customer.city ASC NULLS LAST, fullname ASC NULLS LAST;
      Query failed: org.apache.drill.exec.rpc.RpcException: Remote failure while running query.[error_id: "18220efe-a9f8-450c-bbf7-4ef1cf873cd0"
      endpoint {
      address: "qa-node120.qa.lab"
      user_port: 31010
      control_port: 31011
      data_port: 31012
      }
      error_type: 0
      message: "Failure while parsing sql. < ValidationException:[ org.eigenbase.util.EigenbaseContextException: From line 1, column 571 to line 1, column 578 ] < EigenbaseContextException:[ From line 1, column 571 to line 1, column 578 ] < SqlValidatorException:[ Column 'fullname' is ambiguous ]"
      ]
      Error: exception while executing query (state=,code=0)

      If I qualify the column name 'fullname' as 'customer.fullname', then query works.

      The thing is with similar but a bit simplified query that I do not qualify the column name, it works fine. Only fails for this particular query. So far, I failed to isolate the problem. For example, the following query works without qualifying the column name:

      0: jdbc:drill:schema=dfs> select customer.country as c0, fullname as c4 from customer as customer group by customer.country, fullname limit 4;
      ----------------------+

      c0 c4

      ----------------------+

      [B@6fe52815 [B@2daab417
      [B@2215696d [B@2bbc8496
      [B@65a4aa48 [B@1da7911a
      [B@6427512b [B@5142116b

      ----------------------+
      4 rows selected (0.491 seconds)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              cchang@maprtech.com Chun Chang
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: