[
https://issues.apache.org/jira/browse/BEAM-5141?focusedWorklogId=134342&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-134342
]
ASF GitHub Bot logged work on BEAM-5141:
----------------------------------------
Author: ASF GitHub Bot
Created on: 13/Aug/18 23:18
Start Date: 13/Aug/18 23:18
Worklog Time Spent: 10m
Work Description: apilloud 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_r209788346
##########
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 "
+ + "query. You could run 'RESET %s' in Shell to reset the
option.",
+ matcher.group(2), matcher.group(2)));
Review comment:
Would be nice if the original exception was preserved. Can you add it as an
argument to the new one?
----------------------------------------------------------------
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: 134342)
Time Spent: 40m (was: 0.5h)
> 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: 40m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)