[
https://issues.apache.org/jira/browse/BEAM-5141?focusedWorklogId=134375&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-134375
]
ASF GitHub Bot logged work on BEAM-5141:
----------------------------------------
Author: ASF GitHub Bot
Created on: 14/Aug/18 01:01
Start Date: 14/Aug/18 01:01
Worklog Time Spent: 10m
Work Description: akedin commented on a change in pull request #6216:
[BEAM-5141] Improve error message when SET unregistered options
URL: https://github.com/apache/beam/pull/6216#discussion_r209797657
##########
File path:
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/rel/BeamEnumerableConverter.java
##########
@@ -118,7 +120,25 @@ public static PipelineOptions
createPipelineOptions(Map<String, String> map) {
for (Map.Entry<String, String> entry : map.entrySet()) {
args[i++] = "--" + entry.getKey() + "=" + entry.getValue();
}
- PipelineOptions options =
PipelineOptionsFactory.fromArgs(args).withValidation().create();
+
+ PipelineOptions options = null;
+ try {
+ options =
PipelineOptionsFactory.fromArgs(args).withValidation().create();
+ } catch (IllegalArgumentException e) {
+ Matcher matcher =
+ Pattern.compile("Class (.+) missing a property named
\\'(.+)\\'\\.(.*)")
+ .matcher(e.getMessage());
+ if (matcher.matches()) {
+ throw new IllegalArgumentException(
+ String.format(
+ "You may have SET an unregistered option '%s', which could
have failed current "
Review comment:
I don't think the message is clearer now. Confusing bit is "registration",
what does it mean that I have set the unregistered option? How did I do that?
How to undo that? How is it related to reset? How do I register the new option?
People who are running this may be not sure what the runner is.
I would say something simpler, like "Pipeline option %s is not supported in
this context. You can reset it with 'RESET %s;' command. For the list of
supported pipeline options please check the documentation for class %".
And when re-throwing an exception, always wrap the original one as `cause`,
at the very least it keeps the stack trace intact
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 134375)
Time Spent: 1h 10m (was: 1h)
> Improve error message when SET unregistered options
> ----------------------------------------------------
>
> Key: BEAM-5141
> URL: https://issues.apache.org/jira/browse/BEAM-5141
> Project: Beam
> Issue Type: Improvement
> Components: dsl-sql
> Reporter: Rui Wang
> Assignee: Rui Wang
> Priority: Major
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)