pjson

In [ ]:
pjson(path: str, 
      ingest_local: bool = True,)

Parses a JSON file using flex tables and identifies the columns and their respective types.

Parameters

Name Type Optional Description
path
str
Absolute path of the JSON file.
ingest_local
bool
If set to true, the file will be ingested from the local machine.

Returns

dict : dictionary containing for each column its type.

Example

In [1]:
from verticapy.utilities import *
# Parsing the JSON file
pjson("titanic.json")
Out[1]:
{'datasetid': 'Varchar(36)',
 'fields.age': 'Float',
 'fields.cabin': 'Varchar(30)',
 'fields.embarked': 'Varchar(20)',
 'fields.fare': 'Float',
 'fields.name': 'Varchar(164)',
 'fields.parch': 'Integer',
 'fields.passengerid': 'Integer',
 'fields.pclass': 'Integer',
 'fields.sex': 'Varchar(20)',
 'fields.sibsp': 'Integer',
 'fields.survived': 'Boolean',
 'fields.ticket': 'Varchar(36)',
 'record_timestamp': 'Timestamp',
 'recordid': 'Uuid'}

See Also

read_csv Ingests a CSV file in the Vertica DB.
read_json Ingests a JSON file in the Vertica DB.