Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Won't Fix
-
None
-
None
-
None
Description
Hcatalog always creates partitions in lower case, hence falcon should always look for partitions by converting them to lower case
Ex:
(source table)
CREATE EXTERNAL TABLE in_table (word STRING, cnt INT) PARTITIONED BY (Year STRING, Month STRING, Date STRING, Hour STRING, Minute STRING) STORED AS TEXTFILE LOCATION '/user/suhas/hcat-data/in/';
(target table)
CREATE EXTERNAL TABLE replicated_in_table (word STRING, cnt INT) PARTITIONED BY (Year STRING, Month STRING, Date STRING, Hour STRING, Minute STRING) STORED AS TEXTFILE LOCATION '/user/suhas/hcat-data/replicated_in/';
The partitions in Hcat will be:
year=2014/month=08/date=05/hour=00/minute=00
year=2014/month=08/date=05/hour=00/minute=01
year=2014/month=08/date=05/hour=00/minute=02
year=2014/month=08/date=05/hour=00/minute=03
year=2014/month=08/date=05/hour=00/minute=04
In such case falcon replication is failing with:
org.apache.oozie.action.hadoop.JavaMainException: org.apache.falcon.FalconException: Exception fetching partition:org.apache.hcatalog.common.HCatException : 9001 : Exception occurred while processing HCat request : Invalid partition-key specified: year at org.apache.oozie.action.hadoop.JavaMain.run(JavaMain.java:58) at org.apache.oozie.action.hadoop.LauncherMain.run(LauncherMain.java:39) at org.apache.oozie.action.hadoop.JavaMain.main(JavaMain.java:36) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.oozie.action.hadoop.LauncherMapper.map(LauncherMapper.java:226) at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:50) at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:417) at org.apache.hadoop.mapred.MapTask.run(MapTask.java:332) at org.apache.hadoop.mapred.Child$4.run(Child.java:268) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:415) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1438) at org.apache.hadoop.mapred.Child.main(Child.java:262) Caused by: org.apache.falcon.FalconException: Exception fetching partition:org.apache.hcatalog.common.HCatException : 9001 : Exception occurred while processing HCat request : Invalid partition-key specified: year at org.apache.falcon.catalog.HiveCatalogService.getPartition(HiveCatalogService.java:235) at org.apache.falcon.latedata.LateDataHandler.getTablePartitionCreateTimeMetric(LateDataHandler.java:243) at org.apache.falcon.latedata.LateDataHandler.computeStorageMetric(LateDataHandler.java:183) at org.apache.falcon.latedata.LateDataHandler.computeMetrics(LateDataHandler.java:124) at org.apache.falcon.latedata.LateDataHandler.run(LateDataHandler.java:101) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70) at org.apache.falcon.latedata.LateDataHandler.main(LateDataHandler.java:60) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.oozie.action.hadoop.JavaMain.run(JavaMain.java:55) ... 15 more