[
https://issues.apache.org/jira/browse/CASSANDRA-20331?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17927764#comment-17927764
]
Bernardo Botella Corbi commented on CASSANDRA-20331:
----------------------------------------------------
Hi [~lukasz.antoniak]. I'm working on this one. I was thinking on adding a
system schema table like this:
{code:java}
private static final TableMetadata ColumnConstraints =
parse(COLUMN_CONSTRAINTS,
"column constraints registry",
"CREATE TABLE %s ("
+ "keyspace_name text,"
+ "table_name text,"
+ "column_name text,"
+ "constraint_types frozen<list<text>>,"
+ "constraint_functions frozen<list<text>>,"
+ "constraint_conditions frozen<list<text>>,"
+ "constraint_terms frozen<list<text>>,"
+ "PRIMARY KEY ((keyspace_name), table_name, column_name))");
{code}
Would this work?
> Expose constraints in system_schema.column_constraints
> ------------------------------------------------------
>
> Key: CASSANDRA-20331
> URL: https://issues.apache.org/jira/browse/CASSANDRA-20331
> Project: Apache Cassandra
> Issue Type: Task
> Components: Feature/Constraints
> Reporter: Stefan Miklosovic
> Assignee: Bernardo Botella Corbi
> Priority: Normal
> Fix For: 5.x
>
>
> There is already system_schema.column_masks
> {code}
> CREATE TABLE system_schema.column_masks (
> keyspace_name text,
> table_name text,
> column_name text,
> function_argument_nulls frozen<list<boolean>>,
> function_argument_types frozen<list<text>>,
> function_argument_values frozen<list<text>>,
> function_keyspace text,
> function_name text,
> PRIMARY KEY (keyspace_name, table_name, column_name)
> ) WITH CLUSTERING ORDER BY (table_name ASC, column_name ASC)
> {code}
> We need this table with constraints of each column, similar to masks. Right
> now there is no programmatic way to realize what constraints a column has.
> This will come handy when Java Driver will start to support this. They will
> just scan system_schema.column_constraints and they can e.g. fail the query
> on client side it will never reach the server ...
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]