Memsql:如何使用load命令或加载器加载TPCH数据

时间:2015-10-26 15:01:54

标签: memsql

我为区域表生成的数据格式低于。

    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 |

我尝试了多个版本的load命令来加载区域表中的上述数据

    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 loader实用程序实现相同功能。

1 个答案:

答案 0 :(得分:3)

dbgen的默认输出格式应加载fields terminated by '|' lines terminated by '|\n'