Help with Connect and JSON file

You are viewing an old version of this question. View the current version here.

I have been trying to learn how to use the connect command with a JSON file. I have downloaded some stock data (large JSON file) and have tried the following:

create table testjson (Code char(12), Sector char(45) jpath='$.Sector') engine=CONNECT table_type=JSON File_name='/data/www/portfiles/port8146935093/sp500.json';

My output is:

Query OK, 0 rows affected (0.086 sec)

MariaDB [buylist]> select * from testjson;

+------+--------+

CodeSector

+------+--------+

NULLNULL

+------+--------+

1 row in set (0.002 sec)

The JSON file is large, it contains multiple companies, but below is part of the beginning of the file:

{"0":{"Code":"AIZ","Exchange":"US","Name":"Assurant Inc","Sector":"Financial Services","Industry":"Insurance-Specialty"},"1":{"Code":"MNST"

I have the latest version of Mariadb and connect installed.

What do I have wrong in the sql command??

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.