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

Cast integer to binary returns incorrect result

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.12.0
    • Fix Version/s: None
    • Labels:
      None

      Description

      This query returns an empty binary string:
      select cast(123 as binary) from (values(1));

      The same problem occurs for bigint, float and double.
      Casting works if the data type is date, time, timestamp, interval, varchar and binary.

      select cast(date '2018-08-10' as binary) from (values(1));

      select length(string_binary(cast(123 as binary))), length(string_binary(cast(date '2018-08-10' as binary))) from (values(1));
      ----------------+

      EXPR$0 EXPR$1

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

      0 10

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

        Attachments

          Activity

            People

            • Assignee:
              karthikm Karthikeyan Manivannan
              Reporter:
              rhou Robert Hou
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: