本文整理汇总了C++中SQLUtility::getPSQL方法的典型用法代码示例。如果您正苦于以下问题:C++ SQLUtility::getPSQL方法的具体用法?C++ SQLUtility::getPSQL怎么用?C++ SQLUtility::getPSQL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SQLUtility
的用法示例。
在下文中一共展示了SQLUtility::getPSQL方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: char
TEST_F(TestParquet, TestSize) {
SQLUtility util;
// value/record size equal to pagesize/rowgroupsize
util.execute("drop table if exists t31");
util.execute(
"create table t31 (a1 char(10485760), a2 char(10485760), a3 "
"char(10485760), a4 char(10485760), a5 char(10485760), a6 "
"char(10485760), a7 char(10485760), a8 char(10485760), a9 "
"char(10485760), a10 char(10485760)) with(appendonly=true, "
"orientation=parquet, pagesize=10485760, rowgroupsize=104857600)");
util.execute(
"insert into t31 values ( ('a'::char(10485760)), "
"('a'::char(10485760)), ('a'::char(10485760)), ('a'::char(10485760)), "
"('a'::char(10485760)), ('a'::char(10485760)), ('a'::char(10485760)), "
"('a'::char(10485760)), ('a'::char(10485760)), ('a'::char(10485760)) );",
false);
EXPECT_STREQ("ERROR: value for column \"a1\" exceeds pagesize 10485760!",
util.getPSQL()->getLastResult().substr(0, 56).c_str());
// single column, one data page contains several values, one rwo group
// contains several groups
util.execute("drop table if exists t32");
util.execute("drop table if exists t33");
util.execute(
"create table t32 ( a1 text ) with(appendonly=true, "
"orientation=parquet)");
util.execute("insert into t32 values(repeat('parquet',100))");
util.execute("insert into t32 values(repeat('parquet',20))");
util.execute("insert into t32 values(repeat('parquet',30))");
util.execute(
"create table t33 ( a1 text ) with(appendonly=true, orientation=parquet, "
"pagesize=1024, rowgroupsize=1025)");
util.execute("insert into t33 select * from t32");
util.query("select * from t33", 3);
// large data insert, several column values in one page, several rows in one
// rowgroup
util.execute("drop table if exists t34");
util.execute("drop table if exists t35");
util.execute(
"create table t34 (a1 char(1048576), a2 char(2048576), a3 "
"char(3048576), a4 char(4048576), a5 char(5048576), a6 char(6048576), a7 "
"char(7048576), a8 char(8048576), a9 char(9048576), a10 char(9)) "
"with(appendonly=true, orientation=parquet, pagesize=10485760, "
"rowgroupsize=90874386)");
util.execute(
"insert into t34 values ( ('a'::char(1048576)), "
"('a'::char(2048576)), ('a'::char(3048576)), ('a'::char(4048576)), "
"('a'::char(5048576)), ('a'::char(6048576)), ('a'::char(7048576)), "
"('a'::char(8048576)), ('a'::char(9048576)), ('a'::char(9)) )");
util.execute(
"create table t35 (a1 char(1048576), a2 char(2048576), a3 "
"char(3048576), a4 char(4048576), a5 char(5048576), a6 char(6048576), a7 "
"char(7048576), a8 char(8048576), a9 char(9048576), a10 char(9)) "
"with(appendonly=true, orientation=parquet, pagesize=10485760, "
"rowgroupsize=17437200)");
util.execute("insert into t35 select * from t34");
util.query("select * from t35", 1);
}