Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-2867 JSON support
  3. CALCITE-2872

Support for specifying encoding in JSON representation clause

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Syntax of JSON representation clause:

      <JSON representation> ::= JSON [ ENCODING { UTF8 | UTF16 | UTF32 } ] | <implementation-defined JSON representation option>
      

      From ISO/IEC 9075-6[1]:

      A <JSON value expression> may have an optional <JSON input clause>. This indicates that the values expression should be parsed as JSON. The standardized option is FORMAT JSON; implementations may also support syntax such as FORMAT AVRO or FORMAT BSON. When using the <JSON input clause>, the <value expression> may be either a character string or a binary string.

      Currently we have already added base syntax support of UTF8/UTF16/UTF32 encoded JSON to parser[2]. However the flags won't appear in parse tree for now.

      [1] http://standards.iso.org/ittf/PubliclyAvailableStandards/c065143_ISO_IEC_TR_19075-5_2016.zip
      [2] https://github.com/apache/calcite/blob/master/core/src/main/codegen/templates/Parser.jj#L4875

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              zhztheplayer Hongze Zhang
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: