Skip to content

Show

Overview

Compatible Spark/Pyspark

The show node prints useful informations on whatever data it receives. In oarticular if it receives datasets, it will print out a quick view of datasets columns and the associated scxhema. You can control the output format, regular spark-like dataset dumps, i.e.:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
+---+-------+
| id|clicked|
+---+-------+
|  4|    1.6|
|  8|    3.9|
+---+-------+

root
 |-- id: integer (nullable = false)
 |-- clicked: double (nullable = false)

Using the vertical settings you can dump rows vertically:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
-RECORD 0------
 id      | 0
 clicked | 1.8
-RECORD 1------
 id      | 1
 clicked | 1.0
-RECORD 2------
 id      | 2
 clicked | 4.5
only showing top 3 rows

Example(s)

You can also dumps the dataset using a json format. It will look as follows:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  {
    "name": "random_split_left",
    "title": "SHOW",
    "dataset": {
      "schema": [
        {
          "column": "id",
          "type": "IntegerType"
        },
        {
          "column": "clicked",
          "type": "DoubleType"
        }
      ],
      "count": 8,
      "rows": [
        [
          0,
          1.8
        ],
        [
          1,
          1.0
        ],
        [
          2,
          4.5
        ]
      ]
    }
  },

If instead a model is received teh show node will print out useful information about that particular, model using a json format.

Configuration(s)

Here is an example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{
  job: [
    {
        type: show
        component: show
        settings: {
            // optional title
            title: INPUT

            // Optional you can select some specific columns 
            // of your input dataset
            // select: [ "features", "label" ]

            // Optional. Default if false
            json_format: false

            // Optional, default is true. Only relevant for json
            // output format. 
            pretty: true

            // Optional, set to false to not truncate long row values
            truncate: true

            // Optional set to true, prints out rows vertically
            vertical: false

            // Optional, default is 10
            num_rows: 10

            // Optional, also show the schema
            show_schema: true
        }
        subscribe: [
            {
                component: input
                stream: data
            }
        ]
    }
  ]
}