Memsql:如何使用load命令或loader加载TPCH数据
Memsql: how to use load command or loader to load TPCH data
我为区域 table 生成的数据格式如下。
0|AFRICA|lar deposits. blithely final packages cajole. regular waters are final requests. regular accounts are according to |
1|AMERICA|hs use ironic, even requests. s |
2|ASIA|ges. thinly even pinto beans ca |
3|EUROPE|ly final courts cajole furiously final excuse |
4|MIDDLE EAST|uickly special accounts cajole carefully blithely close requests. carefully final asymptotes haggle furiousl |
我尝试了多个版本的加载命令来加载区域 table
中的上述数据
CREATE REFERENCE TABLE REGION (" +
"R_REGIONKEY INTEGER NOT NULL PRIMARY KEY," +
"R_NAME CHAR(25) NOT NULL," +
"R_COMMENT VARCHAR(152))
1. stmt.execute(s"load data infile \'$filename\' into table REGION COLUMNS TERMINATED BY \'|\'");
2. stmt.execute(s"load data infile \'$filename\' into table REGION FIELDS TERMINATED BY \'|\'");
3. stmt.execute(s"load data infile \'$filename\' into table REGION COLUMNS TERMINATED BY \'|\' LINES TERMINATED BY \'\n\'");
4.stmt.execute(s"load data infile \'$filename\' into table REGION FIELDS TERMINATED BY \'|\' LINES TERMINATED BY \'|\'");
但是没有成功。帮助我格式化正确的加载命令以以给定格式加载数据。还让我知道如何使用 Memsql 加载程序实用程序实现相同的目的。
dbgen 的默认输出格式应使用 fields terminated by '|' lines terminated by '|\n'
加载
我为区域 table 生成的数据格式如下。
0|AFRICA|lar deposits. blithely final packages cajole. regular waters are final requests. regular accounts are according to |
1|AMERICA|hs use ironic, even requests. s |
2|ASIA|ges. thinly even pinto beans ca |
3|EUROPE|ly final courts cajole furiously final excuse |
4|MIDDLE EAST|uickly special accounts cajole carefully blithely close requests. carefully final asymptotes haggle furiousl |
我尝试了多个版本的加载命令来加载区域 table
中的上述数据 CREATE REFERENCE TABLE REGION (" +
"R_REGIONKEY INTEGER NOT NULL PRIMARY KEY," +
"R_NAME CHAR(25) NOT NULL," +
"R_COMMENT VARCHAR(152))
1. stmt.execute(s"load data infile \'$filename\' into table REGION COLUMNS TERMINATED BY \'|\'");
2. stmt.execute(s"load data infile \'$filename\' into table REGION FIELDS TERMINATED BY \'|\'");
3. stmt.execute(s"load data infile \'$filename\' into table REGION COLUMNS TERMINATED BY \'|\' LINES TERMINATED BY \'\n\'");
4.stmt.execute(s"load data infile \'$filename\' into table REGION FIELDS TERMINATED BY \'|\' LINES TERMINATED BY \'|\'");
但是没有成功。帮助我格式化正确的加载命令以以给定格式加载数据。还让我知道如何使用 Memsql 加载程序实用程序实现相同的目的。
dbgen 的默认输出格式应使用 fields terminated by '|' lines terminated by '|\n'