You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@carbondata.apache.org by suyash_yadav <su...@persistent.co.in> on 2019/06/20 10:42:07 UTC
How to define constraints and indexes in carbondata while creating
a table.
We have one database created in oracle where we have multiple
constraints/index and now we are trying to replicate the whole schema into
apache carbondata but we are facing issues as we could not find relevant
documentation/examples.
For e.g. we have below constraints/indexes defined in our table:-
CONSTRAINT "PK_SGGH" PRIMARY KEY ("IDX_GROUP_PARENT", "IDX_GROUP_CHILD",
"DTE_DATE", "STR_ACTION") ENABLE
) ORGANIZATION INDEX NOCOMPRESS PCTFREE 10 INITRANS 2 MAXTRANS 255
LOGGING
STORAGE(INITIAL 1048576 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "PV_CFHD"
PCTTHRESHOLD 50;
REM INSERTING into PV_ADMIN.SE_GRP_GROUP_HIST
SET DEFINE OFF
CREATE INDEX "PV_ADMIN"."ID_SGGH_2_1" ON "PV_ADMIN"."SE_GRP_GROUP_HIST"
("IDX_GROUP_CHILD", "IDX_GROUP_PARENT")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 131072 NEXT 131072 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "PV_CFGI" ;
Please go through above points and let me know if there is a way to define
constraints like primary keys, foreign keys, NOT NULL etc in apache
carbondata.
Regards
Suyash Yadav
--
Sent from: http://apache-carbondata-dev-mailing-list-archive.1130556.n5.nabble.com/
Re: How to define constraints and indexes in carbondata while
creating a table.
Posted by David CaiQiang <da...@gmail.com>.
doc:
https://github.com/apache/carbondata/blob/master/docs/ddl-of-carbondata.md#sort-columns-configuration
testcase:
https://github.com/apache/carbondata/blob/a6ab97ca40427af5225f12a063a0e44221a503e1/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/sortcolumns/TestSortColumns.scala
-----
Best Regards
David Cai
--
Sent from: http://apache-carbondata-dev-mailing-list-archive.1130556.n5.nabble.com/
Re: How to define constraints and indexes in carbondata while
creating a table.
Posted by suyash_yadav <su...@persistent.co.in>.
Thanks David,
Do you have any examples where you have used SORT_COLUMN which can help us
to understand how this can behave similar to primary keys and other
constraints on oracle/db2?
If yes then kindly share it with us.
Regards
Suyash Yadav
--
Sent from: http://apache-carbondata-dev-mailing-list-archive.1130556.n5.nabble.com/
Re: How to define constraints and indexes in carbondata while
creating a table.
Posted by David CaiQiang <da...@gmail.com>.
As so far, Carbondata don't support primary keys, foreign keys, NOT NULL,
etc.
Table creation can use SORT_COLUMNS to create the main index, but the
secondary index doesn't be supported.
-----
Best Regards
David Cai
--
Sent from: http://apache-carbondata-dev-mailing-list-archive.1130556.n5.nabble.com/