You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@zeppelin.apache.org by Carmella Smith <ca...@adobe.com> on 2017/06/30 00:01:49 UTC

Issues with nested json in change config api?

Hello User Support,

I’m trying to use the update congifuration api described here:
https://zeppelin.apache.org/docs/0.7.0/rest-api/rest-notebook.html#update-paragraph-configuration

It works fine for changing the colWidth and editorHide config settings.  I submit the request, I refresh the zeppelin ui, and I see the colWidth changed and the editor visible.

I’m also trying to change from a graph mode of “table” to “lineChart”, and set the key and value.  The response indicates it’s good, there is no error in any log file, but refreshing the zeppelin ui shows no change.  Examining the response shows that graph mode is still “table.”  Is this update config api expected to work with nested json such as the graph element?  Does the sample in the API doc work to change the graph mode?

Thanks for any hints anyone there may suggest,
Carmella Smith


My sql in the editor:
%psql
select mp_name, date_hour,
lb_auction_count, lat_auction_count, ub_auction_count from feedkey_rollup
where mp_name like 'Adap.tvRTB%'
and logdate >= Dateadd(DAY, - 14, CURRENT_DATE ())
order by date_hour


My json body for the PUT:
{
  "colWidth": 4.0,
  "graph": {
    "mode": "lineChart",
    "keys": [
      {
        "name": "DATE_HOUR"
      }
    ],
    "values": [
      {
        "name": "LAT_AUCTION_COUNT",
        "aggr": "sum"
      }
    ]
  },
  "editorHide": false
}


The json output I receive:
{
    "status": "OK",
    "message": "",
    "body": {
        "title": "add paragraph 1 measure why not working?",
        "text": "%psql\nselect mp_name, date_hour,\nlb_auction_count, lat_auction_count, ub_auction_count from feedkey_rollup\nwhere mp_name like 'Adap.tvRTB%'\nand logdate >= Dateadd(DAY, - 14, CURRENT_DATE ())\norder by date_hour",
        "user": "anonymous",
        "dateUpdated": "Jun 29, 2017 4:55:49 PM",
        "config": {
            "colWidth": 4,
            "enabled": true,
            "results": {
                "0": {
                    "graph": {
                        "mode": "table",
                        "height": 300,
                        "optionOpen": true,
                        "setting": {
                            "lineChart": {},
                            "multiBarChart": {}
                        },
                        "commonSetting": {},
                        "keys": [],
                        "groups": [],
                        "values": []
                    },
                    "helium": {}
                }
            },
            "editorSetting": {
                "language": "scala"
            },
            "editorMode": "ace/mode/markdown",
            "title": true,
            "tableHide": false,
            "editorHide": false,
            "graph": {
                "keys": [
                    {
                        "name": "DATE_HOUR"
                    }
                ],
                "values": [
                    {
                        "name": "LAT_AUCTION_COUNT",
                        "aggr": "sum"
                    }
                ]
            }
        },
        "settings": {
            "params": {},
            "forms": {}
        },
        "results": {
            "code": "SUCCESS",
            "msg": [
                {
                    "type": "TABLE",
                    "data": "MP_NAME\tDATE_HOUR\tLB_AUCTION_COUNT\tLAT_AUCTION_COUNT\tUB_AUCTION_COUNT\nAdap.tvRTB\t2017-06-15
…..


Issues with nested json in change config api?

Posted by Carmella Smith <ca...@adobe.com>.
Hello User Support,

I’m trying to use the update congifuration api described here:
https://zeppelin.apache.org/docs/0.7.0/rest-api/rest-notebook.html#update-paragraph-configuration

It works fine for changing the colWidth and editorHide config settings.  I submit the request, I refresh the zeppelin ui, and I see the colWidth changed and the editor visible.

I’m also trying to change from a graph mode of “table” to “lineChart”, and set the key and value.  The response indicates it’s good, there is no error in any log file, but refreshing the zeppelin ui shows no change.  Examining the response shows that graph mode is still “table.”  Is this update config api expected to work with nested json such as the graph element?  Does the sample in the API doc work to change the graph mode?

Thanks for any hints anyone there may suggest,
Carmella Smith


My sql in the editor:
%psql
select mp_name, date_hour,
lb_auction_count, lat_auction_count, ub_auction_count from feedkey_rollup
where mp_name like 'Adap.tvRTB%'
and logdate >= Dateadd(DAY, - 14, CURRENT_DATE ())
order by date_hour


My json body for the PUT:
{
  "colWidth": 4.0,
  "graph": {
    "mode": "lineChart",
    "keys": [
      {
        "name": "DATE_HOUR"
      }
    ],
    "values": [
      {
        "name": "LAT_AUCTION_COUNT",
        "aggr": "sum"
      }
    ]
  },
  "editorHide": false
}


The json output I receive:
{
    "status": "OK",
    "message": "",
    "body": {
        "title": "add paragraph 1 measure why not working?",
        "text": "%psql\nselect mp_name, date_hour,\nlb_auction_count, lat_auction_count, ub_auction_count from feedkey_rollup\nwhere mp_name like 'Adap.tvRTB%'\nand logdate >= Dateadd(DAY, - 14, CURRENT_DATE ())\norder by date_hour",
        "user": "anonymous",
        "dateUpdated": "Jun 29, 2017 4:55:49 PM",
        "config": {
            "colWidth": 4,
            "enabled": true,
            "results": {
                "0": {
                    "graph": {
                        "mode": "table",
                        "height": 300,
                        "optionOpen": true,
                        "setting": {
                            "lineChart": {},
                            "multiBarChart": {}
                        },
                        "commonSetting": {},
                        "keys": [],
                        "groups": [],
                        "values": []
                    },
                    "helium": {}
                }
            },
            "editorSetting": {
                "language": "scala"
            },
            "editorMode": "ace/mode/markdown",
            "title": true,
            "tableHide": false,
            "editorHide": false,
            "graph": {
                "keys": [
                    {
                        "name": "DATE_HOUR"
                    }
                ],
                "values": [
                    {
                        "name": "LAT_AUCTION_COUNT",
                        "aggr": "sum"
                    }
                ]
            }
        },
        "settings": {
            "params": {},
            "forms": {}
        },
        "results": {
            "code": "SUCCESS",
            "msg": [
                {
                    "type": "TABLE",
                    "data": "MP_NAME\tDATE_HOUR\tLB_AUCTION_COUNT\tLAT_AUCTION_COUNT\tUB_AUCTION_COUNT\nAdap.tvRTB\t2017-06-15
…..