Uploaded image for project: 'CDAP'
  1. CDAP
  2. CDAP-7199

Documentation for setting schema on existing table does not work

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.5.0
    • Fix Version/s: 3.5.1
    • Component/s: Datasets, Docs
    • Labels:
    • Rank:
      1|hzzlbj:

      Description

      Copy-paste from the docs to command line (replacing host and table name):

      curl -w"\n" -X PUT "http://localhost:10000/v3/namespaces/default/data/datasets/mytable/properties"   -d '{ "typeName": "table", \
              "properties": { \
                "schema": "{ \
                  \"type\":\"record\", \
                  \"name\":\"purchase\", \
                  \"fields\":[ \
                    {\"name\":\"id\",\"type\":\"string\"}, \
                    {\"name\":\"name\",\"type\":\"string\"}, \
                    {\"name\":\"email\",\"type\":\"string\"}, \
                    {\"name\":\"login\",\"type\":[\"long\", \"null\"]}, \
                    {\"name\":\"active\",\"type\":[\"long\", \"null\"]} \
                  ] \
                }", \
                "schema.row.field": "id" \
              } \
            }'
      com.google.gson.stream.MalformedJsonException: Expected name at line 1 column 24
      

      This is the section in the docs: http://docs.cask.co/cdap/current/en/developers-manual/data-exploration/tables.html#setting-a-schema-on-an-existing-table

        Attachments

          Activity

            People

            • Assignee:
              andreas Andreas Neumann
              Reporter:
              andreas Andreas Neumann
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: