Skip to content

Instantly share code, notes, and snippets.

@vagetablechicken
Created July 20, 2022 08:24
Show Gist options
  • Save vagetablechicken/015e3c42e6b3e5a3ab740d3a5efe1cc9 to your computer and use it in GitHub Desktop.
Save vagetablechicken/015e3c42e6b3e5a3ab740d3a5efe1cc9 to your computer and use it in GitHub Desktop.
openmldb test sample

openmldb/bin/openmldb --zk_cluster=127.0.0.1:2181 --zk_root_path=/openmldb --role=sql_client < test.sql 即可 注意test.sql内,c1.csv的路径,需要跟taskmanager(spark.home=local)在同一台机器上,并且写绝对路径。 输出结果里都是SUCCEED,没有ERROR就可以。

We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
c1
1
2
3
create database if not exists test_db;
use test_db;
create table if not exists t1(c1 int);
-- offline mode
set @@sync_job=true;
set @@job_timeout=200000;
load data infile '<abs_path>/c1.csv' into table t1 options(mode='overwrite');
select * from t1 into outfile '/tmp/offline_output' options(mode='overwrite');
-- online mode
set @@execute_mode='online';
insert into t1 values(1),(2);
select * from t1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment