Affects Version/s: 1.12.0
Fix Version/s: None
Drill provides table functions (see Using the Formats Attributes as Table Function Parameters) which allow queries to specify properties of format plugins.
All table functions derive from the FormatPluginConfig base class:
The annotation above appears to define a property called type to identify the subtype of the base class, and is used when deserializing JSON for the config object.
Suppose we define a "regex plugin" to let us read a log file using a regex. We define a plugin config for this plugin:
For the above, everything works just fine if we use the config in the normal way (define in the Drill web console or programmatically in a test.)
Suppose we want to change the regex in a table function:
When run (in the debugger, as a test), we get the following error:
The error is thrown in SqlOperator.checkOperandTypes() which calls FamilyOperandTypeChecker.isOptional() which calls WorkspaceSchemaFactory.WithOptionsTableMacro.getParameters() which has somehow decided that the type "parameter" is required.
OK, if it is required, let's provide it:
The above SQL works as expected, producing the proper output.
Since the type is hidden, and is known only to Java developers, the code should not require that the user specify it; especially since there is exactly only one correct value.