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

Hive: hex function from hive returning non-printable characters

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • Future
    • Functions - Hive
    • None

    Description

      git.commit.id.abbrev=48449fe

      The below query returns the data properly from sqlline.

      select hex(l_suppkey) from hive.tpch01_parquet_nodate.lineitem;
      

      However when I use the below code to read it using JDBC, I am getting un-printable characters

      resultSet = statement.executeQuery(query);
      String str = new String(resultSet.getBytes(i));
      

      When I create the string with UTF-16 encoding, things work fine

      String str = new String(resultSet.getBytes(i), java.nio.charset.Charset.forName("UTF-16"))
      

      Most likely there could be nothing wrong with drill and the clients could be resposible for inspecting the types and reading the data accordingly.

      Just wanted to raise this JIRA to verify whether the current behavior is expected or not.

      Attachments

        Activity

          People

            Unassigned Unassigned
            rkins Rahul Kumar Challapalli
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: