You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hawq.apache.org by hu...@apache.org on 2019/08/02 07:20:29 UTC
[hawq] branch master updated (30afd65 -> d95647a)
This is an automated email from the ASF dual-hosted git repository.
huor pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/hawq.git.
from 30afd65 HAWQ-1733.Resolve select issue in external table of orc
new 33ddcf7 HAWQ-1734. Resolve insert issue in external table of orc
new d95647a HAWQ-1735. enable orc feature test
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
src/backend/access/appendonly/appendonlywriter.c | 81 +++++++++++++
src/backend/cdb/cdbdatalocality.c | 33 ++++--
src/backend/cdb/cdbquerycontextdispatching.c | 26 +++-
src/backend/commands/copy.c | 4 +
src/backend/executor/execMain.c | 68 +++++++++--
src/include/access/appendonlywriter.h | 1 +
src/test/feature/.gitignore | 10 +-
src/test/feature/ExternalSource/sql/init_file | 26 ++++
.../feature/ExternalSource/test_extfmt_orc.cpp | 131 +++++++++++----------
9 files changed, 287 insertions(+), 93 deletions(-)
create mode 100644 src/test/feature/ExternalSource/sql/init_file
[hawq] 01/02: HAWQ-1734. Resolve insert issue in external table of
orc
Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
huor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hawq.git
commit 33ddcf7aa87eaa47063496319681627158d76de9
Author: tuyu <tu...@oushu.io>
AuthorDate: Thu Aug 1 15:29:47 2019 +0800
HAWQ-1734. Resolve insert issue in external table of orc
---
src/backend/access/appendonly/appendonlywriter.c | 81 ++++++++++++++++++++++++
src/backend/cdb/cdbdatalocality.c | 33 ++++++++--
src/backend/cdb/cdbquerycontextdispatching.c | 26 ++++++--
src/backend/commands/copy.c | 4 ++
src/backend/executor/execMain.c | 68 ++++++++++++++++----
src/include/access/appendonlywriter.h | 1 +
6 files changed, 189 insertions(+), 24 deletions(-)
diff --git a/src/backend/access/appendonly/appendonlywriter.c b/src/backend/access/appendonly/appendonlywriter.c
index addd33e..629ba3a 100644
--- a/src/backend/access/appendonly/appendonlywriter.c
+++ b/src/backend/access/appendonly/appendonlywriter.c
@@ -1185,6 +1185,72 @@ List *SetSegnoForWrite(List *existing_segnos, Oid relid, int segment_num,
}
+List *SetSegnoForExternalWrite(List *existing_segnos, Oid relid, int segment_num,
+ bool forNewRel, bool reuse_segfilenum_in_same_xid,
+ bool keepHash)
+{
+ /* these vars are used in GP_ROLE_DISPATCH only */
+ AORelHashEntryData *aoentry = NULL;
+ TransactionId CurrentXid = GetTopTransactionId();
+ int next;
+ AOSegfileStatus *segfilestatus = NULL;
+ int remaining_num = segment_num;
+ bool has_same_txn_status = false;
+ AOSegfileStatus **maxSegno4Segment = NULL;
+
+ switch(Gp_role)
+ {
+ case GP_ROLE_EXECUTE:
+
+ Assert(existing_segnos != NIL);
+ Assert(list_length(existing_segnos) == segment_num);
+ return existing_segnos;
+
+ case GP_ROLE_UTILITY:
+
+ Assert(existing_segnos == NIL);
+ Assert(segment_num == 1);
+ return list_make1_int(RESERVED_SEGNO);
+
+ case GP_ROLE_DISPATCH:
+
+ Assert(existing_segnos == NIL);
+ Assert(segment_num > 0);
+
+ if (forNewRel)
+ {
+ int i;
+ for (i = 1; i <= segment_num; i++)
+ {
+ existing_segnos = lappend_int(existing_segnos, i);
+ }
+ return existing_segnos;
+ }
+
+ if (Debug_appendonly_print_segfile_choice)
+ {
+ ereport(LOG, (errmsg("SetSegnoForWrite: Choosing a segno for external "
+ "relation \"%s\" (%d) ",
+ get_rel_name(relid), relid)));
+ }
+
+ for (int i = 0; i < segment_num; i++)
+ {
+ existing_segnos = lappend_int(existing_segnos, i);
+ }
+ Assert(list_length(existing_segnos) == segment_num);
+
+ return existing_segnos;
+
+ /* fix this for dispatch agent. for now it's broken anyway. */
+ default:
+ Assert(false);
+ return NIL;
+ }
+
+ }
+
+
/*
* assignPerRelSegno
*
@@ -1231,6 +1297,21 @@ List *assignPerRelSegno(List *all_relids, int segment_num)
}
}
+ else if (RelationIsExternal(rel))
+ {
+ SegfileMapNode *n;
+
+ n = makeNode(SegfileMapNode);
+ n->relid = cur_relid;
+
+ n->segnos = SetSegnoForExternalWrite(NIL, cur_relid, segment_num,
+ false, true, true);
+
+ Assert(n->relid != InvalidOid);
+ Assert(n->segnos != NIL);
+
+ mapping = lappend(mapping, n);
+ }
/*
* hold RowExclusiveLock until the end of transaction
diff --git a/src/backend/cdb/cdbdatalocality.c b/src/backend/cdb/cdbdatalocality.c
index 55f4ac0..67fe51d 100644
--- a/src/backend/cdb/cdbdatalocality.c
+++ b/src/backend/cdb/cdbdatalocality.c
@@ -4125,15 +4125,34 @@ run_allocation_algorithm(SplitAllocResult *result, List *virtual_segments, Query
int fileCountInRelation = list_length(rel_data->files);
bool FileCountBucketNumMismatch = false;
if (targetPolicy->bucketnum > 0) {
- FileCountBucketNumMismatch = fileCountInRelation %
- targetPolicy->bucketnum == 0 ? false : true;
+ Relation rel = heap_open(rel_data->relid, NoLock);
+ targetPolicy->bucketnum == 0 ? false : true;
+ if (!RelationIsExternal(rel))
+ {
+ FileCountBucketNumMismatch = fileCountInRelation %
+ targetPolicy->bucketnum == 0 ? false : true;
+ }
+ else
+ {
+ ListCell *lc_file;
+ int maxsegno = 0;
+ foreach(lc_file, rel_data->files)
+ {
+ Relation_File *rel_file = (Relation_File *) lfirst(lc_file);
+ if (rel_file->segno > maxsegno)
+ maxsegno = rel_file->segno;
+ }
+ FileCountBucketNumMismatch =
+ maxsegno > targetPolicy->bucketnum ? true : false;
+ }
+ heap_close(rel, NoLock);
}
if (isRelationHash && FileCountBucketNumMismatch && !allow_file_count_bucket_num_mismatch) {
- elog(ERROR, "file count %d in catalog is not in proportion to the bucket "
- "number %d of hash table with oid=%u, some data may be lost, if you "
- "still want to continue the query by considering the table as random, set GUC "
- "allow_file_count_bucket_num_mismatch to on and try again.",
- fileCountInRelation, targetPolicy->bucketnum, myrelid);
+ elog(ERROR, "file count %d in catalog is not in proportion to the bucket "
+ "number %d of hash table with oid=%u, some data may be lost, if you "
+ "still want to continue the query by considering the table as random, set GUC "
+ "allow_file_count_bucket_num_mismatch to on and try again.",
+ fileCountInRelation, targetPolicy->bucketnum, myrelid);
}
/* change the virtual segment order when keep hash.
* order of idMap should also be changed.
diff --git a/src/backend/cdb/cdbquerycontextdispatching.c b/src/backend/cdb/cdbquerycontextdispatching.c
index 88d4f44..167af2a 100644
--- a/src/backend/cdb/cdbquerycontextdispatching.c
+++ b/src/backend/cdb/cdbquerycontextdispatching.c
@@ -2955,10 +2955,6 @@ fetchSegFileInfos(Oid relid, List *segnos)
}
storageChar = get_relation_storage_type(relid);
- /*
- * Get pg_appendonly information for this table.
- */
- aoEntry = GetAppendOnlyEntry(relid, SnapshotNow);
/*
* Based on the pg_appendonly information, fetch
@@ -2967,13 +2963,31 @@ fetchSegFileInfos(Oid relid, List *segnos)
*/
if (RELSTORAGE_AOROWS == storageChar)
{
+ /*
+ * Get pg_appendonly information for this table.
+ */
+ aoEntry = GetAppendOnlyEntry(relid, SnapshotNow);
AOFetchSegFileInfo(aoEntry, result, SnapshotNow);
}
- else
+ else if (RELSTORAGE_PARQUET == storageChar)
{
- Assert(RELSTORAGE_PARQUET == storageChar);
+ /*
+ * Get pg_appendonly information for this table.
+ */
+ aoEntry = GetAppendOnlyEntry(relid, SnapshotNow);
ParquetFetchSegFileInfo(aoEntry, result, SnapshotNow);
}
+ else
+ {
+ /*
+ * Get range info for current magma hash table, which is already
+ * available when get block location and do datalocality
+ */
+ /*
+ * TODO(Zongtian): vsegno -> rg list -> {range list1, ..., range list N}
+ */
+ Assert(RELSTORAGE_EXTERNAL == storageChar);
+ }
}
return result;
}
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c
index 9c21148..dbeda09 100644
--- a/src/backend/commands/copy.c
+++ b/src/backend/commands/copy.c
@@ -4331,6 +4331,9 @@ CopyFrom(CopyState cstate)
resultRelInfo->ri_aosegfileinfos,
GetQEIndex());
+ PlannedStmt* plannedstmt = palloc(sizeof(PlannedStmt));
+ memset(plannedstmt,0,sizeof(PlannedStmt));
+ plannedstmt->scantable_splits = cstate->splits;
resultRelInfo->ri_extInsertDesc =
InvokePlugStorageFormatInsertInit(insertInitFunc,
resultRelInfo->ri_RelationDesc,
@@ -4340,6 +4343,7 @@ CopyFrom(CopyState cstate)
segfileinfo->segno);
pfree(insertInitFunc);
+ pfree(plannedstmt);
}
else
{
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index 81f68f2..e21aeb6 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -875,8 +875,9 @@ ExecutorStart(QueryDesc *queryDesc, int eflags)
result_segfileinfos = GetResultRelSegFileInfos(RelationGetRelid(relinfo->ri_RelationDesc),
estate->es_result_aosegnos, result_segfileinfos);
}
+
plannedstmt->result_segfileinfos = result_segfileinfos;
-
+
if (plannedstmt->intoClause != NULL)
{
List *segment_segnos = SetSegnoForWrite(NIL, 0, GetQEGangNum(), true, true, false);
@@ -1791,7 +1792,6 @@ InitializeResultRelations(PlannedStmt *plannedstmt, EState *estate, CmdType oper
}
}
-
estate->es_partition_state = NULL;
if (estate->es_result_partitions)
{
@@ -2432,7 +2432,7 @@ CreateAppendOnlyParquetSegFileOnMaster(Oid relid, List *mapping)
Relation rel = heap_open(relid, AccessShareLock);
/* only relevant for AO relations */
- if(!RelationIsAoRows(rel) && !RelationIsParquet(rel))
+ if(!RelationIsAoRows(rel) && !RelationIsParquet(rel) && !RelationIsExternal(rel))
{
heap_close(rel, AccessShareLock);
return;
@@ -2466,6 +2466,45 @@ CreateAppendOnlyParquetSegFileOnMaster(Oid relid, List *mapping)
Assert(found);
}
+static void CreateExternalSegFileForRelationOnMaster(Relation rel, List *segnos,
+ SharedStorageOpTasks *addTasks)
+{
+ ParquetFileSegInfo * fsinfo;
+ ListCell *cell;
+
+ Assert(RelationIsExternal(rel));
+
+ char * relname = RelationGetRelationName(rel);
+
+ foreach(cell, segnos)
+ {
+ int segno = lfirst_int(cell);
+
+ Assert(NULL != addTasks);
+ Assert(addTasks->sizeTasks >= addTasks->numTasks);
+
+ RelFileNode *n;
+
+ if (addTasks->sizeTasks == addTasks->numTasks)
+ {
+ addTasks->tasks = repalloc(addTasks->tasks,
+ addTasks->sizeTasks * sizeof(SharedStorageOpTask) * 2);
+ addTasks->sizeTasks *= 2;
+ }
+
+ n = &addTasks->tasks[addTasks->numTasks].node;
+ n->dbNode = rel->rd_node.dbNode;
+ n->relNode = rel->rd_node.relNode;
+ n->spcNode = rel->rd_node.spcNode;
+
+ addTasks->tasks[addTasks->numTasks].segno = segno;
+ addTasks->tasks[addTasks->numTasks].relname = palloc(strlen(relname) + 1);
+ strcpy(addTasks->tasks[addTasks->numTasks].relname, relname);
+
+ addTasks->numTasks++;
+ }
+}
+
static void
CreaateAoRowSegFileForRelationOnMaster(Relation rel,
AppendOnlyEntry * aoEntry, List *segnos, SharedStorageOpTasks *addTask, SharedStorageOpTasks *overwriteTask)
@@ -2647,13 +2686,20 @@ CreateAppendOnlyParquetSegFileForRelationOnMaster(Relation rel, List *segnos)
CreateParquetSegFileForRelationOnMaster(rel, aoEntry, segnos, addTasks, overwriteTasks);
pfree(aoEntry);
+
+ PerformSharedStorageOpTasks(addTasks, Op_CreateSegFile);
+ PostPerformSharedStorageOpTasks(addTasks);
+ PerformSharedStorageOpTasks(overwriteTasks, Op_OverWriteSegFile);
}
+ // TODO: Should we create empty files on orc hash distribution table?
+ // else if (RelationIsExternal(rel))
+ // {
+ // CreateExternalSegFileForRelationOnMaster(rel, segnos, addTasks);
+ // PerformSharedStorageOpTasks(addTasks, Op_CreateSegFile);
+ // }
- PerformSharedStorageOpTasks(addTasks, Op_CreateSegFile);
- PostPerformSharedStorageOpTasks(addTasks);
- PerformSharedStorageOpTasks(overwriteTasks, Op_OverWriteSegFile);
DropSharedStorageOpTasks(addTasks);
- DropSharedStorageOpTasks(overwriteTasks);
+ DropSharedStorageOpTasks(overwriteTasks);
}
/*
@@ -2712,10 +2758,10 @@ ResultRelInfoSetSegFileInfo(ResultRelInfo *resultRelInfo, List *mapping)
/*
* Only relevant for AO relations.
*/
- if (!relstorage_is_ao(RelinfoGetStorage(resultRelInfo)))
- {
- return;
- }
+// if (!relstorage_is_ao(RelinfoGetStorage(resultRelInfo)))
+// {
+// return;
+// }
Assert(mapping);
Assert(resultRelInfo->ri_RelationDesc);
diff --git a/src/include/access/appendonlywriter.h b/src/include/access/appendonlywriter.h
index a943bcb..38d9354 100755
--- a/src/include/access/appendonlywriter.h
+++ b/src/include/access/appendonlywriter.h
@@ -129,6 +129,7 @@ extern void InitAppendOnlyWriter(void);
extern Size AppendOnlyWriterShmemSize(void);
extern bool TestCurrentTspSupportTruncate(Oid tsp);
extern List *SetSegnoForWrite(List *existing_segnos, Oid relid, int segment_num, bool forNewRel, bool reuse_segfilenum_in_same_xid, bool keepHash);
+extern List *SetSegnoForExternalWrite(List *existing_segnos, Oid relid, int segment_num, bool forNewRel, bool reuse_segfilenum_in_same_xid, bool keepHash);
extern List *assignPerRelSegno(List *all_rels, int segment_num);
extern void UpdateMasterAosegTotals(Relation parentrel,
int segno,
[hawq] 02/02: HAWQ-1735. enable orc feature test
Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
huor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hawq.git
commit d95647a51f16accc37107fbffbb9a9009fa3ef81
Author: tuyu <tu...@oushu.io>
AuthorDate: Fri Aug 2 11:29:46 2019 +0800
HAWQ-1735. enable orc feature test
---
src/test/feature/.gitignore | 10 +-
src/test/feature/ExternalSource/sql/init_file | 26 ++++
.../feature/ExternalSource/test_extfmt_orc.cpp | 131 +++++++++++----------
3 files changed, 98 insertions(+), 69 deletions(-)
diff --git a/src/test/feature/.gitignore b/src/test/feature/.gitignore
index 10fc2f6..9792d03 100644
--- a/src/test/feature/.gitignore
+++ b/src/test/feature/.gitignore
@@ -6,11 +6,13 @@ feature-test
# test generated files
**/*.out
**/*.diff
+**/.DS_Store
+**/*.o.tmp
+
+ExternalSource/ans/*.ans
+ExternalSource/data/*
+ExternalSource/sql/*.sql
-ExternalSource/ans/external_oid.ans
-ExternalSource/ans/exttab1.ans
-ExternalSource/sql/external_oid.sql
-ExternalSource/sql/exttab1.sql
UDF/ans/function_c.ans
UDF/ans/function_creation.ans
UDF/sql/function_c.sql
diff --git a/src/test/feature/ExternalSource/sql/init_file b/src/test/feature/ExternalSource/sql/init_file
new file mode 100644
index 0000000..925032a
--- /dev/null
+++ b/src/test/feature/ExternalSource/sql/init_file
@@ -0,0 +1,26 @@
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+-- start_matchignore
+s/LINE.*exttable_ext.*_test/exttable_ext_test/
+s/.*failed to begin insert: type not supported for orc.*/failed to begin insert: type not supported for orc/
+s/.*Rounded overflowing value.*/Rounded overflowing value/
+s/.*ERROR: value out of range/ERROR: value out of range/
+s/.*ERROR: magma: magma client: failed to end insert into table*/ERROR: magma: magma client: failed to end insert into table/g
+s/.*ERROR: failed to insert .*into table*/ERROR: failed to insert into table/g
+s/.*ERROR: NewExecutorRun: failed to do MyExecutorRun. Invalid column selected .*/ERROR: NewExecutorRun: failed to do MyExecutorRun. Invalid column selected/g
+s/.*ERROR: ComputeNode catches error. .* failed due to Invalid column selected . */ERROR: NewExecutorRun: failed to do MyExecutorRun. Invalid column selected/g
+s/psql:.*.sql/psql:sqlfile.sql/g
+s/test_pg_stat_activity_history | .* vcore | .* MB |/test_pg_stat_activity_history | vcore | MB |/g
+
+-- end_matchignore
+
diff --git a/src/test/feature/ExternalSource/test_extfmt_orc.cpp b/src/test/feature/ExternalSource/test_extfmt_orc.cpp
index 0805ab6..bc3831c 100644
--- a/src/test/feature/ExternalSource/test_extfmt_orc.cpp
+++ b/src/test/feature/ExternalSource/test_extfmt_orc.cpp
@@ -691,7 +691,7 @@ TEST_F(TestExtOrc, TestDatatypeMoney) {
ASSERT_TRUE(status);
}
-TEST_F(TestExtOrc, TestTruncate) {
+TEST_F(TestExtOrc, DISABLED_TestTruncate) {
SQLUtility util;
HdfsConfig hc;
std::string result;
@@ -760,17 +760,17 @@ TEST_F(TestExtOrc, BoolTypeTest) {
"(\'" +
url + "\') FORMAT 'orc'");
util.execute("insert into t10 values('yes'),('n'),(null),('0'),(true)");
- util.query("set new_executor=off; select * from t10 where p='f' or p is true",
+ util.query("select * from t10 where p='f' or p is true",
"t|\nf|\nf|\nt|\n");
- util.query("set new_executor=off; select * from t10 where not p is unknown",
+ util.query("select * from t10 where not p is unknown",
"t|\nf|\nf|\nt|\n");
- util.query("set new_executor=off; select * from t10 where 't' > p",
+ util.query("select * from t10 where 't' > p",
"f|\nf|\n");
- util.query("set new_executor=off; select * from t10 where p != 't'",
+ util.query("select * from t10 where p != 't'",
"f|\nf|\n");
}
-TEST_F(TestExtOrc, DateTypeTest) {
+TEST_F(TestExtOrc, DISABLED_DateTypeTest) {
SQLUtility util;
std::string url = generateUrl(util, "TestExtOrc_DateTypeTest");
ASSERT_FALSE(url.empty());
@@ -785,67 +785,67 @@ TEST_F(TestExtOrc, DateTypeTest) {
"03'),('1999-Jan-08'),('Jan-08-1999'),('08-Jan-1999'),('"
"19990108'),('990108'),('1999.008'),('J2451187'),('0099-01-08 BC')");
util.query(
- "set new_executor=off; set datestyle to 'ISO, MDY'; select * from t11 "
+ "set datestyle to 'ISO, MDY'; select * from t11 "
"where p != '2001-1-1'",
"1999-01-08|\n1999-01-08|\n2003-01-02|\n1999-01-08|"
"\n1999-01-08|\n1999-01-08|\n1999-01-08|\n1999-01-08|\n1999-01-08|"
"\n1999-01-08|\n0099-01-08 BC|\n");
util.query(
- "set new_executor=off; set datestyle to 'ISO, MDY'; select * from t11 "
+ "set datestyle to 'ISO, MDY'; select * from t11 "
"where p < '2000-1-1'",
"1999-01-08|\n1999-01-08|\n1999-01-08|"
"\n1999-01-08|\n1999-01-08|\n1999-01-08|\n1999-01-08|\n1999-01-08|"
"\n1999-01-08|\n0099-01-08 BC|\n");
util.query(
- "set new_executor=off; select p - '2002-01-02' from t11 where p > "
+ "select p - '2002-01-02' from t11 where p > "
"'2000-1-1'",
"365|\n");
util.query(
- "set new_executor=off; set datestyle to 'ISO, MDY'; select * from t11 "
+ "set datestyle to 'ISO, MDY'; select * from t11 "
"where p = '0099-1-8 BC'",
"0099-01-08 BC|\n");
util.query(
- "set new_executor=off; set datestyle to 'ISO, DMY'; select * from t11 "
+ "set datestyle to 'ISO, DMY'; select * from t11 "
"where p = '0099-1-8 BC'",
"0099-01-08 BC|\n");
util.query(
- "set new_executor=off; set datestyle to 'ISO, YMD'; select * from t11 "
+ "set datestyle to 'ISO, YMD'; select * from t11 "
"where p = '0099-1-8 BC'",
"0099-01-08 BC|\n");
util.query(
- "set new_executor=off; set datestyle to 'Postgres, MDY'; select * from "
+ "set datestyle to 'Postgres, MDY'; select * from "
"t11 where p = '0099-1-8 BC'",
"01-08-0099 BC|\n");
util.query(
- "set new_executor=off; set datestyle to 'Postgres, DMY'; select * from "
+ "set datestyle to 'Postgres, DMY'; select * from "
"t11 where p = '0099-1-8 BC'",
"08-01-0099 BC|\n");
util.query(
- "set new_executor=off; set datestyle to 'Postgres, YMD'; select * from "
+ "set datestyle to 'Postgres, YMD'; select * from "
"t11 where p = '0099-1-8 BC'",
"01-08-0099 BC|\n");
util.query(
- "set new_executor=off; set datestyle to 'SQL, MDY'; select * from t11 "
+ "set datestyle to 'SQL, MDY'; select * from t11 "
"where p = '0099-1-8 BC'",
"01/08/0099 BC|\n");
util.query(
- "set new_executor=off; set datestyle to 'SQL, DMY'; select * from t11 "
+ "set datestyle to 'SQL, DMY'; select * from t11 "
"where p = '0099-1-8 BC'",
"08/01/0099 BC|\n");
util.query(
- "set new_executor=off; set datestyle to 'SQL, YMD'; select * from t11 "
+ "set datestyle to 'SQL, YMD'; select * from t11 "
"where p = '0099-1-8 BC'",
"01/08/0099 BC|\n");
util.query(
- "set new_executor=off; set datestyle to 'German, MDY'; select * from t11 "
+ "set datestyle to 'German, MDY'; select * from t11 "
"where p = '0099-1-8 BC'",
"08.01.0099 BC|\n");
util.query(
- "set new_executor=off; set datestyle to 'German, DMY'; select * from t11 "
+ "set datestyle to 'German, DMY'; select * from t11 "
"where p = '0099-1-8 BC'",
"08.01.0099 BC|\n");
util.query(
- "set new_executor=off; set datestyle to 'German, YMD'; select * from t11 "
+ "set datestyle to 'German, YMD'; select * from t11 "
"where p = '0099-1-8 BC'",
"08.01.0099 BC|\n");
}
@@ -866,19 +866,20 @@ TEST_F(TestExtOrc, TimeTypeTest) {
"PM'),('04:05:06.789-8'),('04:05:06-08:00'),('04:05-08:00'),('040506-08')"
",('04:05:06 PST'),('2003-04-12 04:05:06 America/New_York')");
util.query(
- "set new_executor=off; select * from t12 where p = '04:05:06'",
+ "select * from t12 where p = '04:05:06'",
"04:05:06|\n04:05:06|\n04:05:06|\n04:05:06|\n04:05:06|\n04:05:06|\n");
- util.query("set new_executor=off; select * from t12 where p = '04:05:06.79'",
+ util.query("select * from t12 where p = '04:05:06.79'",
"04:05:06.79|\n04:05:06.79|\n");
- util.query("set new_executor=off; select * from t12 where p > '04:05:06'",
+ util.query("select * from t12 where p > '04:05:06'",
"04:05:06.79|\n16:05:00|\n04:05:06.79|\n");
- util.query("set new_executor=off; select * from t12 where p < '04:05:06'",
+ util.query("select * from t12 where p < '04:05:06'",
"04:05:00|\n04:05:00|\n04:05:00|\n");
}
TEST_F(TestExtOrc, TimestampTypeTest) {
SQLUtility util;
std::string url = generateUrl(util, "TestExtOrc_TimestampTypeTest");
+ std::cout << url << std::endl;
ASSERT_FALSE(url.empty());
util.execute("drop external table if exists t13");
util.execute(
@@ -889,60 +890,60 @@ TEST_F(TestExtOrc, TimestampTypeTest) {
"insert into t13 values('1999-01-08 04:05:06'), ('January 8 04:05:06 "
"1999 PST'), ('1999-01-08 04:05:06.01 BC')");
util.query(
- "set new_executor=off; set datestyle to 'ISO, YMD'; select * from t13 "
+ "set datestyle to 'ISO, YMD'; select * from t13 "
"where p > '1999-01-08 04:05:06 BC'",
"1999-01-08 04:05:06|\n1999-01-08 04:05:06|\n1999-01-08 04:05:06.01 "
"BC|\n");
util.query(
- "set new_executor=off; set datestyle to 'ISO, YMD'; select * from t13 "
+ "set datestyle to 'ISO, YMD'; select * from t13 "
"where p < '1999-01-08 04:05:06'",
"1999-01-08 04:05:06.01 BC|\n");
util.query(
- "set new_executor=off; set datestyle to 'ISO, MDY'; select * from t13 "
+ "set datestyle to 'ISO, MDY'; select * from t13 "
"where p = '1999-01-08 04:05:06'",
"1999-01-08 04:05:06|\n1999-01-08 04:05:06|\n");
util.query(
- "set new_executor=off; set datestyle to 'ISO, DMY'; select * from t13 "
+ "set datestyle to 'ISO, DMY'; select * from t13 "
"where p = '1999-01-08 04:05:06'",
"1999-01-08 04:05:06|\n1999-01-08 04:05:06|\n");
util.query(
- "set new_executor=off; set datestyle to 'ISO, YMD'; select * from t13 "
+ "set datestyle to 'ISO, YMD'; select * from t13 "
"where p = '1999-01-08 04:05:06'",
"1999-01-08 04:05:06|\n1999-01-08 04:05:06|\n");
util.query(
- "set new_executor=off; set datestyle to 'Postgres, MDY'; select * from "
+ "set datestyle to 'Postgres, MDY'; select * from "
"t13 where p = '1999-01-08 04:05:06'",
"Fri Jan 08 04:05:06 1999|\nFri Jan 08 04:05:06 1999|\n");
util.query(
- "set new_executor=off; set datestyle to 'Postgres, DMY'; select * from "
+ "set datestyle to 'Postgres, DMY'; select * from "
"t13 where p = '1999-01-08 04:05:06'",
"Fri 08 Jan 04:05:06 1999|\nFri 08 Jan 04:05:06 1999|\n");
util.query(
- "set new_executor=off; set datestyle to 'Postgres, YMD'; select * from "
+ "set datestyle to 'Postgres, YMD'; select * from "
"t13 where p = '1999-01-08 04:05:06'",
"Fri Jan 08 04:05:06 1999|\nFri Jan 08 04:05:06 1999|\n");
util.query(
- "set new_executor=off; set datestyle to 'SQL, MDY'; select * from t13 "
+ "set datestyle to 'SQL, MDY'; select * from t13 "
"where p = '1999-01-08 04:05:06'",
"01/08/1999 04:05:06|\n01/08/1999 04:05:06|\n");
util.query(
- "set new_executor=off; set datestyle to 'SQL, DMY'; select * from t13 "
+ "set datestyle to 'SQL, DMY'; select * from t13 "
"where p = '1999-01-08 04:05:06'",
"08/01/1999 04:05:06|\n08/01/1999 04:05:06|\n");
util.query(
- "set new_executor=off; set datestyle to 'SQL, YMD'; select * from t13 "
+ "set datestyle to 'SQL, YMD'; select * from t13 "
"where p = '1999-01-08 04:05:06'",
"01/08/1999 04:05:06|\n01/08/1999 04:05:06|\n");
util.query(
- "set new_executor=off; set datestyle to 'German, MDY'; select * from t13 "
+ "set datestyle to 'German, MDY'; select * from t13 "
"where p = '1999-01-08 04:05:06'",
"08.01.1999 04:05:06|\n08.01.1999 04:05:06|\n");
util.query(
- "set new_executor=off; set datestyle to 'German, DMY'; select * from t13 "
+ "set datestyle to 'German, DMY'; select * from t13 "
"where p = '1999-01-08 04:05:06'",
"08.01.1999 04:05:06|\n08.01.1999 04:05:06|\n");
util.query(
- "set new_executor=off; set datestyle to 'German, YMD'; select * from t13 "
+ "set datestyle to 'German, YMD'; select * from t13 "
"where p = '1999-01-08 04:05:06'",
"08.01.1999 04:05:06|\n08.01.1999 04:05:06|\n");
}
@@ -957,15 +958,15 @@ TEST_F(TestExtOrc, BinaryTypeTest) {
"(\'" +
url + "\') FORMAT 'orc'");
util.execute("insert into t14 values('haha'), ('233'), ('666'), ('ok')");
- util.query("set new_executor=off; select * from t14",
+ util.query("select * from t14",
"haha|\n233|\n666|\nok|\n");
- util.query("set new_executor=off; select octet_length(arr) from t14",
+ util.query("select octet_length(arr) from t14",
"4|\n3|\n3|\n2|\n");
- util.query("set new_executor=off; select * from t14 where arr > '233'",
+ util.query("select * from t14 where arr > '233'",
"haha|\n666|\nok|\n");
- util.query("set new_executor=off; select * from t14 where arr = '233'",
+ util.query("select * from t14 where arr = '233'",
"233|\n");
- util.query("set new_executor=off; select * from t14 where arr < '666'",
+ util.query("select * from t14 where arr < '666'",
"233|\n");
}
@@ -981,7 +982,7 @@ TEST_F(TestExtOrc, StringTypeTest) {
"LOCATION (\'" +
url + "\') FORMAT 'orc'");
util.execute("insert into t15 values('0', 'a ', 'b ', 'c', 'd', 'e');");
- util.query("set new_executor=off; select * from t15", "0|a|b |c|d|e|\n");
+ util.query("select * from t15", "0|a|b |c|d|e|\n");
}
TEST_F(TestExtOrc, DISABLED_SmallIntArrayTypeTest) {
@@ -994,7 +995,7 @@ TEST_F(TestExtOrc, DISABLED_SmallIntArrayTypeTest) {
"(\'" +
url + "\') FORMAT 'orc'");
util.execute("insert into t16 values('{1,2,3}'), ('{NULL, 2}'), (NULL);");
- util.query("set new_executor=off; select * from t16",
+ util.query("select * from t16",
"{1,2,3}|\n{NULL,2}|\n|\n");
}
@@ -1008,7 +1009,7 @@ TEST_F(TestExtOrc, DISABLED_IntArrayTypeTest) {
"(\'" +
url + "\') FORMAT 'orc'");
util.execute("insert into t17 values('{1,2,3}'), ('{NULL, 2}'), (NULL);");
- util.query("set new_executor=off; select * from t17",
+ util.query("select * from t17",
"{1,2,3}|\n{NULL,2}|\n|\n");
}
@@ -1022,7 +1023,7 @@ TEST_F(TestExtOrc, DISABLED_BigIntArrayTypeTest) {
"(\'" +
url + "\') FORMAT 'orc'");
util.execute("insert into t18 values('{1,2,3}'), ('{NULL, 2}'), (NULL);");
- util.query("set new_executor=off; select * from t18",
+ util.query("select * from t18",
"{1,2,3}|\n{NULL,2}|\n|\n");
}
@@ -1036,7 +1037,7 @@ TEST_F(TestExtOrc, DISABLED_FloatArrayTypeTest) {
"(\'" +
url + "\') FORMAT 'orc'");
util.execute("insert into t19 values('{1,2,3}'), ('{NULL, 2}'), (NULL);");
- util.query("set new_executor=off; select * from t19",
+ util.query("select * from t19",
"{1,2,3}|\n{NULL,2}|\n|\n");
}
@@ -1050,7 +1051,7 @@ TEST_F(TestExtOrc, DISABLED_DoubleArrayTypeTest) {
"(\'" +
url + "\') FORMAT 'orc'");
util.execute("insert into t20 values('{1,2,3}'), ('{NULL, 2}'), (NULL);");
- util.query("set new_executor=off; select * from t20",
+ util.query("select * from t20",
"{1,2,3}|\n{NULL,2}|\n|\n");
}
@@ -1071,7 +1072,7 @@ TEST_F(TestExtOrc, DISABLED_SmallIntArrayTypeWithSortedAnsTest) {
util.execute(
"insert into t22 values(12, NULL),(13, "
"'{NULL,1,2,3}');");
- util.query("set new_executor=off; select * from t22 order by i",
+ util.query("select * from t22 order by i",
"1||\n2||\n11|{1,2,NULL,4,5,NULL}|\n12||\n13|{NULL,1,2,3}|\n31|{1,"
"2,3}|\n||\n");
}
@@ -1092,7 +1093,7 @@ TEST_F(TestExtOrc, DISABLED_IntArrayTypeWithSortedAnsTest) {
util.execute(
"insert into t23 values(12, NULL),(13, "
"'{NULL,1,2,3}');");
- util.query("set new_executor=off; select * from t23 order by i",
+ util.query("select * from t23 order by i",
"1||\n2||\n11|{1,2,NULL,4,5,NULL}|\n12||\n13|{NULL,1,2,3}|\n31|{1,"
"2,3}|\n||\n");
}
@@ -1114,7 +1115,7 @@ TEST_F(TestExtOrc, DISABLED_BigIntArrayTypeWithSortedAnsTest) {
util.execute(
"insert into t24 values(12, NULL),(13, "
"'{NULL,1,2,3}');");
- util.query("set new_executor=off; select * from t24 order by i",
+ util.query("select * from t24 order by i",
"1||\n2||\n11|{1,2,NULL,4,5,NULL}|\n12||\n13|{NULL,1,2,3}|\n31|{1,"
"2,3}|\n||\n");
}
@@ -1135,7 +1136,7 @@ TEST_F(TestExtOrc, DISABLED_FloatArrayTypeWithSortedAnsTest) {
util.execute(
"insert into t25 values(12, NULL),(13, "
"'{NULL,1,2,3}');");
- util.query("set new_executor=off; select * from t25 order by i",
+ util.query("select * from t25 order by i",
"1||\n2||\n11|{1,2,NULL,4,5,NULL}|\n12||\n13|{NULL,1,2,3}|\n31|{1,"
"2,3}|\n||\n");
}
@@ -1157,7 +1158,7 @@ TEST_F(TestExtOrc, DISABLED_DoubleArrayTypeWithSortedAnsTest) {
util.execute(
"insert into t26 values(12, NULL),(13, "
"'{NULL,1,2,3}');");
- util.query("set new_executor=off; select * from t26 order by i",
+ util.query("select * from t26 order by i",
"1||\n2||\n11|{1,2,NULL,4,5,NULL}|\n12||\n13|{NULL,1,2,3}|\n31|{1,"
"2,3}|\n||\n");
}
@@ -1179,13 +1180,13 @@ TEST_F(TestExtOrc, DISABLED_MixedTypeWithArrayTypeTest) {
util.execute(
"insert into t27 values(NULL, 12, 'f', NULL),('{NULL,1,2,3}', 13, NULL, "
"'2018-3-20 11:51:15'), ('{}', NULL, 'eee', '2018-3-20 11:51:14.233');");
- util.query("set new_executor=off; select * from t27 order by i, s",
+ util.query("select * from t27 order by i, s",
"{1,2,NULL,4,5,NULL}|11|abc|Tue Mar 20 11:51:14.233 "
"2018|\n|12|f||\n{NULL,1,2,3}|13||Tue Mar 20 11:51:15 "
"2018|\n{1,2,3}|31||Tue Mar 20 11:51:14 2018|\n{}||eee|Tue Mar 20 "
"11:51:14.233 2018|\n||||\n");
util.query(
- "set new_executor=off; select * from t27 where s is not null "
+ "select * from t27 where s is not null "
"order by t,i ",
"{1,2,3}|31||Tue Mar 20 11:51:14 2018|\n{1,2,NULL,4,5,NULL}|11|abc|Tue "
"Mar 20 11:51:14.233 2018|\n{}||eee|Tue Mar 20 11:51:14.233 "
@@ -1198,11 +1199,11 @@ TEST_F(TestExtOrc, DISABLED_EuclideanMetricFloat8Array) {
util.execute("create table t28 (p float8[]) FORMAT 'orc'");
util.execute("insert into t28 values('{1,2,3}'), ('{1,2}');");
util.query(
- "set new_executor=off; select euclidean_metric_float8array(p, "
+ "select euclidean_metric_float8array(p, "
"array[1,2,3]) from t28;",
"0|\n3|\n");
util.query(
- "set new_executor=off; select euclidean_metric_float8array(p, "
+ "select euclidean_metric_float8array(p, "
"array[1,2]) from t28;",
"3|\n0|\n");
}
@@ -1213,11 +1214,11 @@ TEST_F(TestExtOrc, DISABLED_EuclideanMetricFloat4Array) {
util.execute("create table t29 (p float4[]) FORMAT 'orc'");
util.execute("insert into t29 values('{1,2,3}'), ('{1,2}');");
util.query(
- "set new_executor=off; select euclidean_metric_float4array(p, "
+ "select euclidean_metric_float4array(p, "
"array[1,2,3]) from t29;",
"0|\n3|\n");
util.query(
- "set new_executor=off; select euclidean_metric_float4array(p, "
+ "select euclidean_metric_float4array(p, "
"array[1,2]) from t29;",
"3|\n0|\n");
}
@@ -1228,11 +1229,11 @@ TEST_F(TestExtOrc, DISABLED_CosineDistanceFloat8Array) {
util.execute("create table t30 (p float8[]) FORMAT 'orc'");
util.execute("insert into t30 values('{1,2,0}'), ('{1,2}');");
util.query(
- "set new_executor=off; select cosine_distance_float8array(p, "
+ "select cosine_distance_float8array(p, "
"array[1,2,0]) from t30;",
"1|\n1|\n");
util.query(
- "set new_executor=off; select cosine_distance_float8array(p, "
+ "select cosine_distance_float8array(p, "
"array[1,2]) from t30;",
"1|\n1|\n");
}
@@ -1243,11 +1244,11 @@ TEST_F(TestExtOrc, DISABLED_CosineDistanceFloat4Array) {
util.execute("create table t31 (p float4[]) FORMAT 'orc'");
util.execute("insert into t31 values('{1,2,0}'), ('{1,2}');");
util.query(
- "set new_executor=off; select cosine_distance_float4array(p, "
+ "select cosine_distance_float4array(p, "
"array[1,2,0]) from t31;",
"1|\n1|\n");
util.query(
- "set new_executor=off; select cosine_distance_float4array(p, "
+ "select cosine_distance_float4array(p, "
"array[1,2]) from t31;",
"1|\n1|\n");
}