You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Jan Fernando (JIRA)" <ji...@apache.org> on 2015/10/06 06:51:26 UTC

[jira] [Updated] (PHOENIX-2310) PhoenixConfigurationUtil.getUpsertColumnMetadataList() in Phoenix Mapreduce integration generates incorrect upsert statement for view immediately after issue view DDL

     [ https://issues.apache.org/jira/browse/PHOENIX-2310?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jan Fernando updated PHOENIX-2310:
----------------------------------
    Attachment: PHOENIX-2310-v1.patch

> PhoenixConfigurationUtil.getUpsertColumnMetadataList() in Phoenix Mapreduce integration generates incorrect upsert statement for view immediately after issue view DDL
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-2310
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2310
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.5.2
>            Reporter: Jan Fernando
>            Assignee: Jan Fernando
>         Attachments: PHOENIX-2310-v1.patch
>
>
> We ran into what I believe is a corner case that was causing a M/R job using the Phoenix / Pig integration to fail by virtue of a incorrect UPSERT statement being generated. 
> The issue was intermittent. The bug is that the UPSERT statement generated by PhoenixConfigurationUtil.getUpsertColumnMetadataList() when invoked from PhoenixRecordWriter would, instead of the cf.column_name, would contain for certain columns the result class name + hashcode as generated by Java's Object.toString(). Since this was not a valid column name the Pig Script would blow-up.
> This only occurs if we are attempting to insert data into a Phoenix View and the DDL for the Phoenix View was issued recently such that the MetadataClient cache was for this view was populated by MetaDataClient.createTable(). 
> What is occurring is in this case we wrap the PColumn in a Delegate at lines 1898 and 1909. The DelegateColumn class used to wrap PColumn doesn't implement toString() and so the default Object toString() is used. If you restart the JVM and force Phoenix to re-read the metadata from SYSTEM.CATALOG this doesn't occur as in this case we don't wrap the PColumn instance.
> I have a test to repro and a possible patch I'll attach shortly.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)