硬件环境:
单机部署,centos7
链接
./bin/openmldb --zk_cluster=127.0.0.1:2181 --zk_root_path=/openmldb --role=sql_client
创建数据库 demo_db
和数据表 t1
:
--OpenMLDB CLI
CREATE DATABASE demo_db;
USE demo_db;
CREATE TABLE test(
id string,
vendor_id int,
pickup_datetime timestamp,
passenger_count int,
pickup_longitude double,
pickup_latitude double,
dropoff_longitude double,
dropoff_latitude double,
store_and_fwd_flag string
);
CREATE TABLE train(
id string,
vendor_id int,
pickup_datetime timestamp,
passenger_count int,
pickup_longitude double,
pickup_latitude double,
dropoff_longitude double,
dropoff_latitude double,
store_and_fwd_flag string,
trip_duration int
);
导入离线数据
具体参数:
示例1:parquent文件
--OpenMLDB CLI
USE demo_db;
SET @@execute_mode='offline';
LOAD DATA INFILE '/work/taxi-trip/data/taxi_tour_table_train_simple.snappy.parquet' INTO TABLE t1 options(format='parquet', header=true, mode='append');
示例2:CSV文件
--OpenMLDB CLI
USE demo_db;
SET @@execute_mode='offline';
LOAD DATA INFILE '/data/example/test.csv' INTO TABLE test options(header=true, mode='append');
USE demo_db;
SET @@execute_mode='offline';
LOAD DATA INFILE '/data/example/train.csv' INTO TABLE train options(header=true, mode='append');