Apache Drill
  1. Apache Drill
  2. DRILL-863

query returns incorrect data when columns selected in the reverse order of their existence in the view

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.4.0
    • Component/s: SQL Parser
    • Labels:
      None

      Description

      I have a view beacon_aster, uid column appears before country and this works fine:
      : jdbc:drill:schema=dfs> SELECT uid, country FROM beacon_aster limit 1;
      ----------------------+

      uid country

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

      937021026 US

      ----------------------+
      1 row selected (6.52 seconds)

      But if select country first, it returns other columns after uid:
      0: jdbc:drill:schema=dfs> SELECT country, uid FROM beacon_aster limit 1;
      ----------------------+

      country uid

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

      US 937021026 2816d925-6902-2014-8017-113468677480 2012-09-25 00:00:27.132 20120906.02 60f2761d0e6192a88305054eb06877cb 1 -8 US 9

      Some cases it throws error:
      This works:
      0: jdbc:drill:schema=dfs> SELECT recorded, country FROM beacon_aster limit 1;
      ----------------------+

      recorded country

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

      2012-09-25T00:00:27.132-07:00 US

      ----------------------+
      1 row selected (8.279 seconds)

      But this throws IllegalArgumentException, recorded columns appears before country column:

      0: jdbc:drill:schema=dfs> SELECT country, recorded FROM beacon_aster limit 1;
      Query failed: org.apache.drill.exec.rpc.RpcException: Remote failure while running query.[error_id: "4cd5263c-039d-4e04-a4c7-2b31c5bd4139"
      endpoint

      { address: "mfs101.qa.lab" user_port: 31010 control_port: 31011 data_port: 31012 }

      error_type: 0
      message: "Failure while running fragment. < IllegalArgumentException:[ Invalid format: "2012-09-25 00:00:27.132 20120906.02 60f2761d0e6192a8830..." is malformed at " 20120906.02 60f2761d0e6192a8830..." ]"
      ]
      Error: exception while executing query (state=,code=0)

        Activity

          People

          • Assignee:
            Steven Phillips
            Reporter:
            Vivian Summers
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development