Apache Drill
  1. Apache Drill
  2. DRILL-959

drill fails to display binary in hive correctly

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1.0
    • Component/s: Storage - Hive
    • Labels:
      None
    • Target Version/s:

      Description

      Hive table ddl

      create table alldrilltypes
      (c1 int, c2 boolean, c3 double, c4 string,
      c9 tinyint, c10 smallint, c11 float, c12 bigint,
      c19 binary);

      doing a select from drill works but c19 shows up as binary

      0: jdbc:drill:schema=hive> SELECT c1,c2,c3,c4,c9,c10,c11,c12,c19 from alldrilltypes;
      --------------------------------------------------------------------------------------------

      c1 c2 c3 c4 c9 c10 c11 c12 c19

      --------------------------------------------------------------------------------------------

      null null null null null null null null null
      -1 false -1.1   -1 -1 -1.0 -1 null
      1 true 1.1 1 1 1 1.0 1 [B@661725c1

      --------------------------------------------------------------------------------------------

      A cast does not work either:
      SELECT c1,c2,c3,c4,c9,c10,c11,c12,cast(c19 as varchar) from alldrilltypes;
      message: "Failure while parsing sql. < ValidationException:[ org.eigenbase.util.EigenbaseContextException: From line 1, column 35 to line 1, column 54 ] < EigenbaseContextException:[ From line 1, column 35 to line 1, column 54 ] < SqlValidatorException:[ Cast function cannot convert value of type BINARY(1) to type VARCHAR(1) ]"

        Activity

        Hide
        Venki Korukanti added a comment -

        VarBinary display issues in JDBC similar to those encountered in display of Parquet VarBinary types (because of VarBinaryVector.getObject.toString() method). Cast didn't work here because the type is known here as BINARY (unlike parquet where type is ANY) and Optiq casting rules do not allow casting BINARY to VARCHAR.

        Show
        Venki Korukanti added a comment - VarBinary display issues in JDBC similar to those encountered in display of Parquet VarBinary types (because of VarBinaryVector.getObject .toString() method). Cast didn't work here because the type is known here as BINARY (unlike parquet where type is ANY) and Optiq casting rules do not allow casting BINARY to VARCHAR.
        Hide
        Jacques Nadeau added a comment -

        Moving to future. SQL really expects the use of convert_from rather than cast for binary to real type conversion. A nice to have is known types also allowing cast.

        Show
        Jacques Nadeau added a comment - Moving to future. SQL really expects the use of convert_from rather than cast for binary to real type conversion. A nice to have is known types also allowing cast.
        Hide
        Venki Korukanti added a comment -

        No longer reproes.

        Show
        Venki Korukanti added a comment - No longer reproes.

          People

          • Assignee:
            Mehant Baid
            Reporter:
            Ramana Inukonda Nagaraj
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development