[
https://issues.apache.org/jira/browse/DRILL-7143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16811987#comment-16811987
]
ASF GitHub Bot commented on DRILL-7143:
---------------------------------------
paul-rogers commented on pull request #1726: DRILL-7143: Support default value
for empty columns
URL: https://github.com/apache/drill/pull/1726#discussion_r272855606
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/SchemaHandler.java
##########
@@ -139,6 +139,11 @@ public PhysicalPlan getPlan(SqlNode sqlNode) {
.message(e.getMessage())
.addContext("Error while preparing / creating schema for [%s]",
schemaSource)
.build(logger);
+ } catch (IllegalArgumentException e) {
Review comment:
I did, in fact, use that approach at first. But, there are two distinct
error cases here.
1) Could not read your file: there is something wrong at that level.
2) Could read the file just fine, the file parsed, but there is something
wrong with the semantics (at present of the VarDecimal type.)
We could have conditional logic to create the right kind of error. Or, we
can just do it the easy way as the code here does.
In fact, I think we could change the message for the IOException case to say
that there was a problem reading the file.
By the way, were are parse exceptions reported? Should we be catching parse
exceptions here?
----------------------------------------------------------------
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)