forked from apache/hawq
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HAWQ-1629. Add ORC format using pluggable storage framework.
- Loading branch information
1 parent
6f3337c
commit ae2af74
Showing
18 changed files
with
560 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with 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. | ||
# | ||
MODULE_big = orc | ||
OBJS = orc.o | ||
|
||
PG_CPPFLAGS = -I$(libpq_srcdir) | ||
PG_LIBS = $(libpq_pgport) | ||
|
||
|
||
ifdef USE_PGXS | ||
PGXS := $(shell pg_config --pgxs) | ||
include $(PGXS) | ||
else | ||
subdir = contrib/orc | ||
top_builddir = ../.. | ||
include $(top_builddir)/src/Makefile.global | ||
include $(top_srcdir)/contrib/contrib-global.mk | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
1. Compile ORC format in pluggable storage framework | ||
$ ./configure --with-orc; make -j8; make install | ||
|
||
2. Configure and initialize cluster | ||
$ hawq init cluster -a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,237 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with 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. | ||
*/ | ||
|
||
|
||
#include <json-c/json.h> | ||
|
||
#include "c.h" | ||
#include "port.h" | ||
#include "postgres.h" | ||
#include "fmgr.h" | ||
#include "funcapi.h" | ||
#include "nodes/pg_list.h" | ||
#include "utils/memutils.h" | ||
#include "utils/relcache.h" | ||
#include "utils/uri.h" | ||
#include "utils/formatting.h" | ||
#include "utils/lsyscache.h" | ||
#include "utils/datetime.h" | ||
#include "mb/pg_wchar.h" | ||
#include "commands/defrem.h" | ||
#include "commands/copy.h" | ||
#include "access/tupdesc.h" | ||
#include "access/filesplit.h" | ||
#include "access/plugstorage.h" | ||
#include "cdb/cdbvars.h" | ||
#include "catalog/pg_exttable.h" | ||
#include "catalog/namespace.h" | ||
#include "postmaster/identity.h" | ||
#include "nodes/makefuncs.h" | ||
#include "nodes/plannodes.h" | ||
#include "utils/uri.h" | ||
|
||
|
||
#define ORC_TIMESTAMP_EPOCH_JDATE 2457024 /* == date2j(2015, 1, 1) */ | ||
#define MAX_ORC_ARRAY_DIMS 10000 | ||
|
||
/* Do the module magic dance */ | ||
PG_MODULE_MAGIC; | ||
|
||
/* Validators for pluggable storage format ORC */ | ||
PG_FUNCTION_INFO_V1(orc_validate_interfaces); | ||
PG_FUNCTION_INFO_V1(orc_validate_options); | ||
PG_FUNCTION_INFO_V1(orc_validate_encodings); | ||
PG_FUNCTION_INFO_V1(orc_validate_datatypes); | ||
|
||
/* Accessors for pluggable storage format ORC */ | ||
PG_FUNCTION_INFO_V1(orc_beginscan); | ||
PG_FUNCTION_INFO_V1(orc_getnext_init); | ||
PG_FUNCTION_INFO_V1(orc_getnext); | ||
PG_FUNCTION_INFO_V1(orc_rescan); | ||
PG_FUNCTION_INFO_V1(orc_endscan); | ||
PG_FUNCTION_INFO_V1(orc_stopscan); | ||
PG_FUNCTION_INFO_V1(orc_insert_init); | ||
PG_FUNCTION_INFO_V1(orc_insert); | ||
PG_FUNCTION_INFO_V1(orc_insert_finish); | ||
|
||
/* Definitions of validators for pluggable storage format ORC */ | ||
Datum orc_validate_interfaces(PG_FUNCTION_ARGS); | ||
Datum orc_validate_options(PG_FUNCTION_ARGS); | ||
Datum orc_validate_encodings(PG_FUNCTION_ARGS); | ||
Datum orc_validate_datatypes(PG_FUNCTION_ARGS); | ||
|
||
/* Definitions of accessors for pluggable storage format ORC */ | ||
Datum orc_beginscan(PG_FUNCTION_ARGS); | ||
Datum orc_getnext_init(PG_FUNCTION_ARGS); | ||
Datum orc_getnext(PG_FUNCTION_ARGS); | ||
Datum orc_rescan(PG_FUNCTION_ARGS); | ||
Datum orc_endscan(PG_FUNCTION_ARGS); | ||
Datum orc_stopscan(PG_FUNCTION_ARGS); | ||
Datum orc_insert_init(PG_FUNCTION_ARGS); | ||
Datum orc_insert(PG_FUNCTION_ARGS); | ||
Datum orc_insert_finish(PG_FUNCTION_ARGS); | ||
|
||
|
||
Datum orc_validate_interfaces(PG_FUNCTION_ARGS) | ||
{ | ||
elog(ERROR, "Funtion orc_validate_interfaces has not be completed, please fill it"); | ||
PG_RETURN_VOID(); | ||
} | ||
|
||
/* | ||
* void | ||
* orc_validate_options(List *formatOptions, | ||
* char *formatStr, | ||
* bool isWritable) | ||
*/ | ||
Datum orc_validate_options(PG_FUNCTION_ARGS) | ||
{ | ||
|
||
elog(ERROR, "Funtion orc_validate_options has not be completed, please fill it"); | ||
PG_RETURN_VOID(); | ||
} | ||
|
||
/* | ||
* void | ||
* orc_validate_encodings(char *encodingName) | ||
*/ | ||
Datum orc_validate_encodings(PG_FUNCTION_ARGS) | ||
{ | ||
elog(ERROR, "Funtion orc_validate_encodings has not be completed, please fill it"); | ||
PG_RETURN_VOID(); | ||
} | ||
|
||
/* | ||
* void | ||
* orc_validate_datatypes(TupleDesc tupDesc) | ||
*/ | ||
Datum orc_validate_datatypes(PG_FUNCTION_ARGS) | ||
{ | ||
|
||
elog(ERROR, "Funtion orc_validate_datatypes has not be completed, please fill it"); | ||
PG_RETURN_VOID(); | ||
} | ||
|
||
/* | ||
* FileScanDesc | ||
* orc_beginscan(ExternalScan *extScan, | ||
* ScanState *scanState, | ||
* Relation relation, | ||
* int formatterType, | ||
* char *formatterName) | ||
*/ | ||
Datum orc_beginscan(PG_FUNCTION_ARGS) | ||
{ | ||
|
||
elog(ERROR, "Funtion orc_beginscan has not be completed, please fill it"); | ||
PG_RETURN_POINTER(NULL); | ||
} | ||
|
||
/* | ||
* ExternalSelectDesc | ||
* orc_getnext_init(PlanState *planState, | ||
* ExternalScanState *extScanState) | ||
*/ | ||
Datum orc_getnext_init(PG_FUNCTION_ARGS) | ||
{ | ||
|
||
elog(ERROR, "Funtion orc_getnext_init has not be completed, please fill it"); | ||
PG_RETURN_POINTER(NULL); | ||
} | ||
|
||
/* | ||
* bool | ||
* orc_getnext(FileScanDesc fileScanDesc, | ||
* ScanDirection direction, | ||
* ExternalSelectDesc extSelectDesc, | ||
* ScanState *scanState, | ||
* TupleTableSlot *tupTableSlot) | ||
*/ | ||
Datum orc_getnext(PG_FUNCTION_ARGS) | ||
{ | ||
elog(ERROR, "Funtion orc_getnext has not be completed, please fill it"); | ||
PG_RETURN_VOID(); | ||
} | ||
|
||
/* | ||
* void | ||
* orc_rescan(FileScanDesc scan) | ||
*/ | ||
Datum orc_rescan(PG_FUNCTION_ARGS) | ||
{ | ||
elog(ERROR, "Funtion orc_rescan has not be completed, please fill it"); | ||
PG_RETURN_VOID(); | ||
} | ||
|
||
/* | ||
* void | ||
* orc_endscan(FileScanDesc scan) | ||
*/ | ||
Datum orc_endscan(PG_FUNCTION_ARGS) | ||
{ | ||
|
||
elog(ERROR, "Funtion orc_endscan has not be completed, please fill it"); | ||
PG_RETURN_VOID(); | ||
} | ||
|
||
/* | ||
* void | ||
* orc_stopscan(FileScanDesc scan) | ||
*/ | ||
Datum orc_stopscan(PG_FUNCTION_ARGS) | ||
{ | ||
elog(ERROR, "Funtion orc_stopscan has not be completed, please fill it"); | ||
PG_RETURN_VOID(); | ||
} | ||
|
||
/* | ||
* ExternalInsertDesc | ||
* orc_insert_init(Relation relation, | ||
* int formatterType, | ||
* char *formatterName) | ||
*/ | ||
Datum orc_insert_init(PG_FUNCTION_ARGS) | ||
{ | ||
|
||
elog(ERROR, "Funtion orc_insert_init has not be completed, please fill it"); | ||
PG_RETURN_POINTER(NULL); | ||
} | ||
|
||
/* | ||
* Oid | ||
* orc_insert(ExternalInsertDesc extInsertDesc, | ||
* TupleTableSlot *tupTableSlot) | ||
*/ | ||
Datum orc_insert(PG_FUNCTION_ARGS) | ||
{ | ||
|
||
elog(ERROR, "Funtion orc_insert has not be completed, please fill it"); | ||
PG_RETURN_OID(InvalidOid); | ||
} | ||
|
||
/* | ||
* void | ||
* orc_insert_finish(ExternalInsertDesc extInsertDesc) | ||
*/ | ||
Datum orc_insert_finish(PG_FUNCTION_ARGS) | ||
{ | ||
elog(ERROR, "Funtion orc_insert_finish has not be completed, please fill it"); | ||
PG_RETURN_VOID(); | ||
} | ||
|
Oops, something went wrong.