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

Documentation: Wrong output displayed for convert_from() with a map

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Trivial
    • Resolution: Unresolved
    • 1.8.0
    • None
    • Documentation
    • None

    Description

      In the Drill docs:
      SQL REFERENCE -> SQL FUNCTIONS -> DATA TYPE CONVERSION

      The output for the example shown for convert_from() with a map into JSON is wrong:
      ------------------------- BEGIN EXCERPT ---------------------------------------------------------------------
      This example uses a map as input to return a repeated list vector (JSON).

      SELECT CONVERT_FROM('[

      {a : 100, b: 200}

      ,

      {a:300, b: 400}

      ]' ,'JSON') AS MYCOL1 FROM (VALUES(1));
      --------------------

      MYCOL1

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

      [[1,2],[3,4],[5]]

      --------------------
      1 row selected (0.141 seconds)

      ------------------------- END ----------------------------------------------

      The correct output should be:
      ---------------------------------------
      SELECT CONVERT_FROM('[

      {a : 100, b: 200}

      ,

      {a:300, b: 400}

      ]' ,'JSON') AS MYCOL1 FROM (VALUES(1));
      ----------------------------------------

      MYCOL1

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

      [{"a":100,"b":200},{"a":300,"b":400}]

      ----------------------------------------
      1 row selected (2.618 seconds)

      The error probably resulted from copying the output of the previous example.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ben-zvi Boaz Ben-Zvi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: