[
https://issues.apache.org/jira/browse/PIG-161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12590426#action_12590426
]
Pi Song commented on PIG-161:
-----------------------------
Alan,
Regarding EvalFunc, there are two alternatives here:-
1) Upgrade the old EvalFunc to support type-checking.
2) Keep the old EvalFunc for backward compatibility. Treat it as having all
input/output fields as bytearray. Then you can redesign a new one and mark the
old one as deprecated. .
Methods that we need for UDF type-checking would be:-
- "byte getType()" which returns the output type
- "boolean checkInputSchema(Schema input)" which checks if the input schema is
compatible with the logic in the UDF.
- "Schema tupleOutputSchema(Schema input) which calculates the output schema
based on input schema in case that getType()==TUPLE
- "Schema bagOutputSchema(Schema input) which calculates the output schema
based on input schema in case that getType()==BAG
By default checkInputSchema(), tupleOutputSchema(), and bagOutputSchema()
return null which means we treat everything as bytearray (or tuple of
bytearrays)
To do (1) we will need "boolean useTypeChecking()" (defaults to false) which
indicates whether to use the new set of type checking methods.
Personally I prefer (2).
PS. Though due to the change in schema class, some of the existing UDFs that
implement getInputSchema() may become unusable even we try to keep
backward-compatibility. We just cannot do anything with this.
> Rework physical plan
> --------------------
>
> Key: PIG-161
> URL: https://issues.apache.org/jira/browse/PIG-161
> Project: Pig
> Issue Type: Sub-task
> Reporter: Alan Gates
> Assignee: Alan Gates
> Attachments: arithmeticOperators.patch, incr2.patch, incr3.patch,
> incr4.patch, Phy_AbsClass.patch, pogenerate.patch, pogenerate.patch,
> pogenerate.patch, posort.patch
>
>
> This bug tracks work to rework all of the physical operators as described in
> http://wiki.apache.org/pig/PigTypesFunctionalSpec
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.