You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Eli Reisman (JIRA)" <ji...@apache.org> on 2012/10/14 10:26:04 UTC
[jira] [Commented] (PIG-2910) Add function to read schema from
outout of Schema.toString()
[ https://issues.apache.org/jira/browse/PIG-2910?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13475797#comment-13475797 ]
Eli Reisman commented on PIG-2910:
----------------------------------
My pleasure, thank you!
> Add function to read schema from outout of Schema.toString()
> ------------------------------------------------------------
>
> Key: PIG-2910
> URL: https://issues.apache.org/jira/browse/PIG-2910
> Project: Pig
> Issue Type: Improvement
> Components: impl, parser
> Affects Versions: 0.9.2, 0.10.0, 0.11, 0.10.1
> Reporter: Russell Jurney
> Assignee: Eli Reisman
> Labels: newbie
> Fix For: 0.11
>
> Attachments: PIG-2910-1.patch, PIG-2910-2.patch, PIG-2910-3.patch, PIG-2910-4.patch
>
>
> I want to toString() schemas and send them to the backend via UDFContext. At the moment this requires writing your own toString() method that Utils.getSchemaFromString() can read. Making a readable schema for the backend would be an improvement.
> I spoke with Thejas, who believes this is a bug. The workaround for the moment is, for example:
> String schemaString = inputSchema.toString().substring(1, inputSchema.toString().length() - 1);
> // Set the input schema for processing
> UDFContext context = UDFContext.getUDFContext();
> Properties udfProp = context.getUDFProperties(this.getClass());
> udfProp.setProperty("horton.json.udf.schema", schemaString);
> ...
> schema = Utils.getSchemaFromString(strSchema);
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira