How to define constraints and indexes in carbondata while creating a table.

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to define constraints and indexes in carbondata while creating a table.

suyash_yadav
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/
Reply | Threaded
Open this post in threaded view
|

Re: How to define constraints and indexes in carbondata while creating a table.

David CaiQiang
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/
Best Regards
David Cai
Reply | Threaded
Open this post in threaded view
|

Re: How to define constraints and indexes in carbondata while creating a table.

suyash_yadav
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/
Reply | Threaded
Open this post in threaded view
|

Re: How to define constraints and indexes in carbondata while creating a table.

David CaiQiang