[
https://issues.apache.org/jira/browse/DRILL-7143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16811885#comment-16811885
]
ASF GitHub Bot commented on DRILL-7143:
---------------------------------------
arina-ielchiieva commented on issue #1726: DRILL-7143: Support default value
for empty columns
URL: https://github.com/apache/drill/pull/1726#issuecomment-480590998
@paul-rogers let me summarize new blank handling strategy.
We introduce new column property `drill.blank-as`. It can have four values:
`blank-as`, `null`, `0`, `simple`. User can indicate which strategy to use in
column schema. For example:
`create or replace schema (id int, amount int properties { 'drill.blank-as'
= 'simple' }) for table dfs.tmp.text_table`
If no blank strategy is indicated, behavior is the following:
1. for columns which are not indicated in schema, `blank-as` strategy will
be used. I suggest, we rename `blank-as` value to `blank`. For example:
`property { 'drill.blank-as' = 'blank' }. Why do you think?
2. for nullable columns indicated in schema, `null` strategy will be used.
3. for non-nullable columns indicated in schema with or without default
value, which strategy will be used? `0` or `simple`? So far I don't see much
difference between both, maybe we don't need one of them?
I have left some other comments in the PR, once we clarify this issue and
address code review comments, PR will be good to go.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Enforce column-level constraints when using a schema
> ----------------------------------------------------
>
> Key: DRILL-7143
> URL: https://issues.apache.org/jira/browse/DRILL-7143
> Project: Apache Drill
> Issue Type: Improvement
> Affects Versions: 1.16.0
> Reporter: Paul Rogers
> Assignee: Paul Rogers
> Priority: Major
> Fix For: 1.16.0
>
>
> The recently added schema framework enforces schema constraints at the table
> level. We now wish to add additional constraints at the column level.
> * If a column is marked as "strict", then the reader will use the exact type
> and mode from the column schema, or fail if it is not possible to do so.
> * If a column is marked as required, and provides a default value, then that
> value is used instead of 0 if a row is missing a value for that column.
> This PR may also contain other fixes the the base functional revealed through
> additional testing.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)