hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amareshw...@apache.org
Subject svn commit: r1464915 [1/5] - in /hive/branches/HIVE-4115: ./ common/src/java/org/apache/hadoop/hive/common/ common/src/java/org/apache/hadoop/hive/conf/ conf/ data/files/ hcatalog/build-support/ant/ hcatalog/historical/branches/ hcatalog/historical/sit...
Date Fri, 05 Apr 2013 10:34:11 GMT
Author: amareshwari
Date: Fri Apr  5 10:34:08 2013
New Revision: 1464915

URL: http://svn.apache.org/r1464915
Log:
Merging r1463087 through r1464904 into branch HIVE-4115

Added:
    hive/branches/HIVE-4115/data/files/flights_tiny.txt
      - copied unchanged from r1464904, hive/trunk/data/files/flights_tiny.txt
    hive/branches/HIVE-4115/data/files/over10k
      - copied unchanged from r1464904, hive/trunk/data/files/over10k
    hive/branches/HIVE-4115/data/files/part.rc
      - copied unchanged from r1464904, hive/trunk/data/files/part.rc
    hive/branches/HIVE-4115/data/files/part.seq
      - copied unchanged from r1464904, hive/trunk/data/files/part.seq
    hive/branches/HIVE-4115/data/files/part_tiny.txt
      - copied unchanged from r1464904, hive/trunk/data/files/part_tiny.txt
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/exec/PTFFunctionInfo.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/PTFFunctionInfo.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/exec/PTFOperator.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/PTFOperator.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/exec/PTFPartition.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/PTFPartition.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/exec/PTFPersistence.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/PTFPersistence.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/exec/PTFUtils.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/PTFUtils.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/exec/PartitionTableFunctionDescription.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/PartitionTableFunctionDescription.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/exec/WindowFunctionDescription.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/WindowFunctionDescription.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/exec/WindowFunctionInfo.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/WindowFunctionInfo.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/optimizer/BucketingSortingReduceSinkOptimizer.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/optimizer/BucketingSortingReduceSinkOptimizer.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/parse/PTFInvocationSpec.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/PTFInvocationSpec.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/parse/PTFTranslator.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/PTFTranslator.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/parse/WindowingComponentizer.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/WindowingComponentizer.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/parse/WindowingExprNodeEvaluatorFactory.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/WindowingExprNodeEvaluatorFactory.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/parse/WindowingSpec.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/WindowingSpec.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/plan/PTFDesc.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/PTFDesc.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/plan/PTFDeserializer.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/PTFDeserializer.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFCumeDist.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFCumeDist.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFDenseRank.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFDenseRank.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFFirstValue.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFFirstValue.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFLag.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFLag.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFLastValue.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFLastValue.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFLead.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFLead.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFLeadLag.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFLeadLag.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFNTile.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFNTile.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFPercentRank.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFPercentRank.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFRank.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFRank.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFRowNumber.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFRowNumber.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLeadLag.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLeadLag.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/
      - copied from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/NPath.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/NPath.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/Noop.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/Noop.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/NoopWithMap.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/NoopWithMap.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/TableFunctionEvaluator.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/TableFunctionEvaluator.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/TableFunctionResolver.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/TableFunctionResolver.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/WindowingTableFunction.java
      - copied unchanged from r1464904, hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/WindowingTableFunction.java
    hive/branches/HIVE-4115/ql/src/test/queries/clientnegative/ptf_negative_AggrFuncsWithNoGBYNoPartDef.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientnegative/ptf_negative_AggrFuncsWithNoGBYNoPartDef.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientnegative/ptf_negative_AmbiguousWindowDefn.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientnegative/ptf_negative_AmbiguousWindowDefn.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientnegative/ptf_negative_DistributeByOrderBy.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientnegative/ptf_negative_DistributeByOrderBy.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientnegative/ptf_negative_DuplicateWindowAlias.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientnegative/ptf_negative_DuplicateWindowAlias.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientnegative/ptf_negative_HavingLeadWithNoGBYNoWindowing.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientnegative/ptf_negative_HavingLeadWithNoGBYNoWindowing.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientnegative/ptf_negative_HavingLeadWithPTF.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientnegative/ptf_negative_HavingLeadWithPTF.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientnegative/ptf_negative_InvalidValueBoundary.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientnegative/ptf_negative_InvalidValueBoundary.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientnegative/ptf_negative_JoinWithAmbigousAlias.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientnegative/ptf_negative_JoinWithAmbigousAlias.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientnegative/ptf_negative_PartitionBySortBy.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientnegative/ptf_negative_PartitionBySortBy.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientnegative/ptf_negative_WhereWithRankCond.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientnegative/ptf_negative_WhereWithRankCond.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientnegative/ptf_window_boundaries.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientnegative/ptf_window_boundaries.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientnegative/ptf_window_boundaries2.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientnegative/ptf_window_boundaries2.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/compute_stats_empty_table.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientpositive/compute_stats_empty_table.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/groupby_sort_9.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientpositive/groupby_sort_9.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/groupby_sort_test_1.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientpositive/groupby_sort_test_1.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/leadlag.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientpositive/leadlag.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/leadlag_queries.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientpositive/leadlag_queries.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/mergejoins_mixed.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientpositive/mergejoins_mixed.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/partition_wise_fileformat15.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientpositive/partition_wise_fileformat15.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/partition_wise_fileformat16.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientpositive/partition_wise_fileformat16.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/ptf.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientpositive/ptf.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/ptf_general_queries.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientpositive/ptf_general_queries.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/ptf_npath.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientpositive/ptf_npath.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/ptf_rcfile.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientpositive/ptf_rcfile.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/ptf_seqfile.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientpositive/ptf_seqfile.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/smb_mapjoin_18.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientpositive/smb_mapjoin_18.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/smb_mapjoin_19.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientpositive/smb_mapjoin_19.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/smb_mapjoin_20.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientpositive/smb_mapjoin_20.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/smb_mapjoin_21.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientpositive/smb_mapjoin_21.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/smb_mapjoin_22.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientpositive/smb_mapjoin_22.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/udf_round_3.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientpositive/udf_round_3.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/windowing.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientpositive/windowing.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/windowing_columnPruning.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientpositive/windowing_columnPruning.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/windowing_expressions.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientpositive/windowing_expressions.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/windowing_multipartitioning.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientpositive/windowing_multipartitioning.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/windowing_navfn.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientpositive/windowing_navfn.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/windowing_ntile.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientpositive/windowing_ntile.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/windowing_rank.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientpositive/windowing_rank.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/windowing_udaf.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientpositive/windowing_udaf.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/windowing_windowspec.q
      - copied unchanged from r1464904, hive/trunk/ql/src/test/queries/clientpositive/windowing_windowspec.q
    hive/branches/HIVE-4115/ql/src/test/results/clientnegative/ptf_negative_AggrFuncsWithNoGBYNoPartDef.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientnegative/ptf_negative_AggrFuncsWithNoGBYNoPartDef.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientnegative/ptf_negative_AmbiguousWindowDefn.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientnegative/ptf_negative_AmbiguousWindowDefn.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientnegative/ptf_negative_DistributeByOrderBy.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientnegative/ptf_negative_DistributeByOrderBy.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientnegative/ptf_negative_DuplicateWindowAlias.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientnegative/ptf_negative_DuplicateWindowAlias.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientnegative/ptf_negative_HavingLeadWithNoGBYNoWindowing.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientnegative/ptf_negative_HavingLeadWithNoGBYNoWindowing.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientnegative/ptf_negative_HavingLeadWithPTF.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientnegative/ptf_negative_HavingLeadWithPTF.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientnegative/ptf_negative_InvalidValueBoundary.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientnegative/ptf_negative_InvalidValueBoundary.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientnegative/ptf_negative_JoinWithAmbigousAlias.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientnegative/ptf_negative_JoinWithAmbigousAlias.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientnegative/ptf_negative_PartitionBySortBy.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientnegative/ptf_negative_PartitionBySortBy.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientnegative/ptf_negative_WhereWithRankCond.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientnegative/ptf_negative_WhereWithRankCond.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientnegative/ptf_window_boundaries.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientnegative/ptf_window_boundaries.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientnegative/ptf_window_boundaries2.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientnegative/ptf_window_boundaries2.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/compute_stats_empty_table.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientpositive/compute_stats_empty_table.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/groupby_sort_9.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientpositive/groupby_sort_9.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/groupby_sort_test_1.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientpositive/groupby_sort_test_1.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/leadlag.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientpositive/leadlag.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/leadlag_queries.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientpositive/leadlag_queries.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/mergejoins_mixed.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientpositive/mergejoins_mixed.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/partition_wise_fileformat15.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientpositive/partition_wise_fileformat15.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/partition_wise_fileformat16.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientpositive/partition_wise_fileformat16.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/ptf.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientpositive/ptf.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/ptf_general_queries.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientpositive/ptf_general_queries.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/ptf_npath.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientpositive/ptf_npath.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/ptf_rcfile.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientpositive/ptf_rcfile.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/ptf_seqfile.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientpositive/ptf_seqfile.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/smb_mapjoin_18.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientpositive/smb_mapjoin_18.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/smb_mapjoin_19.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientpositive/smb_mapjoin_19.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/smb_mapjoin_20.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientpositive/smb_mapjoin_20.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/smb_mapjoin_21.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientpositive/smb_mapjoin_21.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/smb_mapjoin_22.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientpositive/smb_mapjoin_22.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/udf_round_3.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientpositive/udf_round_3.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/windowing.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientpositive/windowing.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/windowing_columnPruning.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientpositive/windowing_columnPruning.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/windowing_expressions.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientpositive/windowing_expressions.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/windowing_multipartitioning.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientpositive/windowing_multipartitioning.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/windowing_navfn.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientpositive/windowing_navfn.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/windowing_ntile.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientpositive/windowing_ntile.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/windowing_rank.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientpositive/windowing_rank.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/windowing_udaf.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientpositive/windowing_udaf.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/windowing_windowspec.q.out
      - copied unchanged from r1464904, hive/trunk/ql/src/test/results/clientpositive/windowing_windowspec.q.out
Removed:
    hive/branches/HIVE-4115/hcatalog/historical/branches/
    hive/branches/HIVE-4115/hcatalog/historical/site/
Modified:
    hive/branches/HIVE-4115/   (props changed)
    hive/branches/HIVE-4115/.gitignore
    hive/branches/HIVE-4115/common/src/java/org/apache/hadoop/hive/common/ObjectPair.java
    hive/branches/HIVE-4115/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
    hive/branches/HIVE-4115/conf/hive-default.xml.template
    hive/branches/HIVE-4115/data/files/datatypes.txt
    hive/branches/HIVE-4115/hcatalog/build-support/ant/deploy.xml
    hive/branches/HIVE-4115/jdbc/src/java/org/apache/hive/jdbc/HiveBaseResultSet.java
    hive/branches/HIVE-4115/jdbc/src/java/org/apache/hive/jdbc/HiveResultSetMetaData.java
    hive/branches/HIVE-4115/jdbc/src/java/org/apache/hive/jdbc/Utils.java
    hive/branches/HIVE-4115/jdbc/src/test/org/apache/hive/jdbc/TestJdbcDriver2.java
    hive/branches/HIVE-4115/ql/build.xml
    hive/branches/HIVE-4115/ql/if/queryplan.thrift
    hive/branches/HIVE-4115/ql/src/gen/thrift/gen-cpp/queryplan_types.cpp
    hive/branches/HIVE-4115/ql/src/gen/thrift/gen-cpp/queryplan_types.h
    hive/branches/HIVE-4115/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Operator.java
    hive/branches/HIVE-4115/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/OperatorType.java
    hive/branches/HIVE-4115/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Query.java
    hive/branches/HIVE-4115/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Stage.java
    hive/branches/HIVE-4115/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Task.java
    hive/branches/HIVE-4115/ql/src/gen/thrift/gen-php/Types.php
    hive/branches/HIVE-4115/ql/src/gen/thrift/gen-py/queryplan/ttypes.py
    hive/branches/HIVE-4115/ql/src/gen/thrift/gen-rb/queryplan_types.rb
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/QueryProperties.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/exec/ColumnStatsTask.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/exec/FetchOperator.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/exec/OperatorFactory.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/exec/RowSchema.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/exec/TableScanOperator.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/hooks/LineageInfo.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcUnion.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/metadata/Partition.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/optimizer/ColumnPruner.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/optimizer/ColumnPrunerProcFactory.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GroupByOptimizer.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/optimizer/Optimizer.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/optimizer/lineage/Generator.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/optimizer/unionproc/UnionProcFactory.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/parse/ASTNode.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/parse/FromClauseParser.g
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/parse/ParseContext.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/parse/ParseDriver.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/parse/PrunedPartitionList.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/parse/QB.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/parse/QBParseInfo.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/parse/SelectClauseParser.g
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/plan/ColumnStatsWork.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/plan/TableScanDesc.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/ppd/OpProcFactory.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/ppd/PredicatePushDown.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFRound.java
    hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFComputeStats.java
    hive/branches/HIVE-4115/ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestOrcFile.java
    hive/branches/HIVE-4115/ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestOrcStruct.java
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/columnstats_tbllvl.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/nonreserved_keywords_insert_into1.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/serde_regex.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/smb_mapjoin_17.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/union_remove_12.q
    hive/branches/HIVE-4115/ql/src/test/queries/clientpositive/union_remove_13.q
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/columnstats_tbllvl.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/join_filters_overlap.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/nonreserved_keywords_insert_into1.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/serde_regex.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/show_functions.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/smb_mapjoin_17.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/udf_round.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/union_remove_12.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/union_remove_13.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/union_remove_14.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/union_remove_2.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/union_remove_22.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/union_remove_23.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/union_remove_24.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/union_remove_3.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/union_remove_4.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/union_remove_5.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/union_remove_7.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/union_remove_8.q.out
    hive/branches/HIVE-4115/ql/src/test/results/clientpositive/union_remove_9.q.out
    hive/branches/HIVE-4115/ql/src/test/results/compiler/errors/wrong_distinct2.q.out
    hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/RegexSerDe.java
    hive/branches/HIVE-4115/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ObjectInspectorConverters.java
    hive/branches/HIVE-4115/service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java

Propchange: hive/branches/HIVE-4115/
------------------------------------------------------------------------------
  Merged /hive/trunk:r1463087-1464904

Modified: hive/branches/HIVE-4115/.gitignore
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/.gitignore?rev=1464915&r1=1464914&r2=1464915&view=diff
==============================================================================
--- hive/branches/HIVE-4115/.gitignore (original)
+++ hive/branches/HIVE-4115/.gitignore Fri Apr  5 10:34:08 2013
@@ -9,3 +9,8 @@ build-eclipse
 *~
 metastore_db
 common/src/gen
+.idea
+*.iml
+*.ipr
+*.iws
+

Modified: hive/branches/HIVE-4115/common/src/java/org/apache/hadoop/hive/common/ObjectPair.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/common/src/java/org/apache/hadoop/hive/common/ObjectPair.java?rev=1464915&r1=1464914&r2=1464915&view=diff
==============================================================================
--- hive/branches/HIVE-4115/common/src/java/org/apache/hadoop/hive/common/ObjectPair.java (original)
+++ hive/branches/HIVE-4115/common/src/java/org/apache/hadoop/hive/common/ObjectPair.java Fri Apr  5 10:34:08 2013
@@ -18,6 +18,8 @@
 
 package org.apache.hadoop.hive.common;
 
+
+
 public class ObjectPair<F, S> {
   private F first;
   private S second;
@@ -44,4 +46,24 @@ public class ObjectPair<F, S> {
   public void setSecond(S second) {
     this.second = second;
   }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null) {
+      return false;
+    }
+    if (that instanceof ObjectPair) {
+      return this.equals((ObjectPair<F, S>)that);
+    }
+    return false;
+  }
+
+  public boolean equals(ObjectPair<F, S> that) {
+    if (that == null) {
+      return false;
+    }
+
+    return this.getFirst().equals(that.getFirst()) &&
+        this.getSecond().equals(that.getSecond());
+  }
 }

Modified: hive/branches/HIVE-4115/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java?rev=1464915&r1=1464914&r2=1464915&view=diff
==============================================================================
--- hive/branches/HIVE-4115/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java (original)
+++ hive/branches/HIVE-4115/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java Fri Apr  5 10:34:08 2013
@@ -423,6 +423,7 @@ public class HiveConf extends Configurat
     HIVEMAPAGGRHASHMINREDUCTION("hive.map.aggr.hash.min.reduction", (float) 0.5),
     HIVEMULTIGROUPBYSINGLEREDUCER("hive.multigroupby.singlereducer", true),
     HIVE_MAP_GROUPBY_SORT("hive.map.groupby.sorted", false),
+    HIVE_MAP_GROUPBY_SORT_TESTMODE("hive.map.groupby.sorted.testmode", false),
     HIVE_GROUPBY_ORDERBY_POSITION_ALIAS("hive.groupby.orderby.position.alias", false),
     HIVE_NEW_JOB_GROUPING_SET_CARDINALITY("hive.new.job.grouping.set.cardinality", 30),
 
@@ -513,6 +514,7 @@ public class HiveConf extends Configurat
 
     HIVEENFORCEBUCKETING("hive.enforce.bucketing", false),
     HIVEENFORCESORTING("hive.enforce.sorting", false),
+    HIVEOPTIMIZEBUCKETINGSORTING("hive.optimize.bucketingsorting", true),
     HIVEPARTITIONER("hive.mapred.partitioner", "org.apache.hadoop.hive.ql.io.DefaultHivePartitioner"),
     HIVEENFORCESORTMERGEBUCKETMAPJOIN("hive.enforce.sortmergebucketmapjoin", false),
     HIVEENFORCEBUCKETMAPJOIN("hive.enforce.bucketmapjoin", false),
@@ -760,6 +762,12 @@ public class HiveConf extends Configurat
 
     // Whether to show the unquoted partition names in query results.
     HIVE_DECODE_PARTITION_NAME("hive.decode.partition.name", false),
+
+    // ptf partition constants
+    HIVE_PTF_PARTITION_PERSISTENCE_CLASS("hive.ptf.partition.persistence",
+      "org.apache.hadoop.hive.ql.exec.PTFPersistence$PartitionedByteBasedList"),
+    HIVE_PTF_PARTITION_PERSISTENT_SIZE("hive.ptf.partition.persistence.memsize",
+      (int) Math.pow(2, (5 + 10 + 10)) ), // 32MB
     ;
 
     public final String varname;

Modified: hive/branches/HIVE-4115/conf/hive-default.xml.template
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/conf/hive-default.xml.template?rev=1464915&r1=1464914&r2=1464915&view=diff
==============================================================================
--- hive/branches/HIVE-4115/conf/hive-default.xml.template (original)
+++ hive/branches/HIVE-4115/conf/hive-default.xml.template Fri Apr  5 10:34:08 2013
@@ -534,6 +534,15 @@
 </property>
 
 <property>
+  <name>hive.map.groupby.sorted.testmode</name>
+  <value>false</value>
+  <description>If the bucketing/sorting properties of the table exactly match the grouping key, whether to
+    perform the group by in the mapper by using BucketizedHiveInputFormat. If the test mode is set, the plan
+    is not converted, but a query property is set to denote the same.
+  </description>
+</property>
+
+<property>
   <name>hive.new.job.grouping.set.cardinality</name>
   <value>30</value>
   <description>
@@ -933,6 +942,16 @@
 </property>
 
 <property>
+  <name>hive.optimize.bucketingsorting</name>
+  <value>true</value>
+  <description>If hive.enforce.bucketing or hive.enforce.sorting is true, dont create a reducer for enforcing
+    bucketing/sorting for queries of the form: 
+    insert overwrite table T2 select * from T1;
+    where T1 and T2 are bucketed/sorted by the same keys into the same number of buckets.
+  </description>
+</property>
+
+<property>
   <name>hive.enforce.sortmergebucketmapjoin</name>
   <value>false</value>
   <description>If the user asked for sort-merge bucketed map-side join, and it cannot be performed,

Modified: hive/branches/HIVE-4115/data/files/datatypes.txt
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/data/files/datatypes.txt?rev=1464915&r1=1464914&r2=1464915&view=diff
==============================================================================
--- hive/branches/HIVE-4115/data/files/datatypes.txt (original)
+++ hive/branches/HIVE-4115/data/files/datatypes.txt Fri Apr  5 10:34:08 2013
@@ -1,3 +1,3 @@
-\N\N\N\N\N\N\N\N\N\N\N\N\N\N\N\N\N\N
--1false-1.1\N\N\N-1-1-1.0-1\N\N\N\N
-1true1.11121x2ykva92.2111.01abcd1111213142212212x1abcd22012-04-22 09:00:00.123456789123456789.0123456
+\N\N\N\N\N\N\N\N\N\N\N\N\N\N\N\N\N\N\N
+-1false-1.1\N\N\N-1-1-1.0-1\N\N\N\N\N
+1true1.11121x2ykva92.2111.01abcd1111213142212212x1abcd22012-04-22 09:00:00.123456789123456789.0123456YWJjZA==

Modified: hive/branches/HIVE-4115/hcatalog/build-support/ant/deploy.xml
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/hcatalog/build-support/ant/deploy.xml?rev=1464915&r1=1464914&r2=1464915&view=diff
==============================================================================
--- hive/branches/HIVE-4115/hcatalog/build-support/ant/deploy.xml (original)
+++ hive/branches/HIVE-4115/hcatalog/build-support/ant/deploy.xml Fri Apr  5 10:34:08 2013
@@ -47,6 +47,9 @@
         <taskdef resource="org/apache/maven/artifact/ant/antlib.xml"
                  uri="artifact:org.apache.maven.artifact.ant"
                  classpath="${path.to.basedir}/build/maven-ant-tasks-${maven-ant-tasks.version}.jar"/>
+        <artifact:dependencies>
+            <dependency groupId="org.apache.hcatalog" artifactId="hcatalog" version="${hcatalog.version}" scope="system" systemPath="${path.to.basedir}/pom.xml"/>
+        </artifact:dependencies>
         <artifact:pom id="mvn.pom" file="pom.xml">
             <profile id="${_mvn.hadoop.profile}"/>
         </artifact:pom>

Modified: hive/branches/HIVE-4115/jdbc/src/java/org/apache/hive/jdbc/HiveBaseResultSet.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/jdbc/src/java/org/apache/hive/jdbc/HiveBaseResultSet.java?rev=1464915&r1=1464914&r2=1464915&view=diff
==============================================================================
--- hive/branches/HIVE-4115/jdbc/src/java/org/apache/hive/jdbc/HiveBaseResultSet.java (original)
+++ hive/branches/HIVE-4115/jdbc/src/java/org/apache/hive/jdbc/HiveBaseResultSet.java Fri Apr  5 10:34:08 2013
@@ -439,6 +439,15 @@ public abstract class HiveBaseResultSet 
     return null;
   }
 
+  private byte[] getBinaryValue(TStringValue tString) {
+    if (tString.isSetValue()) {
+      wasNull = false;
+      return tString.getValue().getBytes();
+    }
+    wasNull = true;
+    return null;
+  }
+
   private BigDecimal getBigDecimalValue(TStringValue tStringValue) {
     if (tStringValue.isSetValue()) {
       wasNull = false;
@@ -480,6 +489,8 @@ public abstract class HiveBaseResultSet 
       return getDoubleValue(tColumnValue.getDoubleVal());
     case STRING_TYPE:
       return getStringValue(tColumnValue.getStringVal());
+    case BINARY_TYPE:
+      return getBinaryValue(tColumnValue.getStringVal());
     case TIMESTAMP_TYPE:
       return getTimestampValue(tColumnValue.getStringVal());
     case DECIMAL_TYPE:
@@ -588,6 +599,9 @@ public abstract class HiveBaseResultSet 
     if (wasNull) {
       return null;
     }
+    if (value instanceof byte[]){
+      return new String((byte[])value);
+    }
     return value.toString();
   }
 

Modified: hive/branches/HIVE-4115/jdbc/src/java/org/apache/hive/jdbc/HiveResultSetMetaData.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/jdbc/src/java/org/apache/hive/jdbc/HiveResultSetMetaData.java?rev=1464915&r1=1464914&r2=1464915&view=diff
==============================================================================
--- hive/branches/HIVE-4115/jdbc/src/java/org/apache/hive/jdbc/HiveResultSetMetaData.java (original)
+++ hive/branches/HIVE-4115/jdbc/src/java/org/apache/hive/jdbc/HiveResultSetMetaData.java Fri Apr  5 10:34:08 2013
@@ -114,6 +114,8 @@ public class HiveResultSetMetaData imple
       return serdeConstants.TIMESTAMP_TYPE_NAME;
     } else if ("decimal".equalsIgnoreCase(type)) {
       return serdeConstants.DECIMAL_TYPE_NAME;
+    } else if ("binary".equalsIgnoreCase(type)) {
+      return serdeConstants.BINARY_TYPE_NAME;
     } else if (type.startsWith("map<")) {
       return serdeConstants.STRING_TYPE_NAME;
     } else if (type.startsWith("array<")) {

Modified: hive/branches/HIVE-4115/jdbc/src/java/org/apache/hive/jdbc/Utils.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/jdbc/src/java/org/apache/hive/jdbc/Utils.java?rev=1464915&r1=1464914&r2=1464915&view=diff
==============================================================================
--- hive/branches/HIVE-4115/jdbc/src/java/org/apache/hive/jdbc/Utils.java (original)
+++ hive/branches/HIVE-4115/jdbc/src/java/org/apache/hive/jdbc/Utils.java Fri Apr  5 10:34:08 2013
@@ -132,6 +132,8 @@ public class Utils {
       return Types.TIMESTAMP;
     } else if ("decimal".equalsIgnoreCase(type)) {
       return Types.DECIMAL;
+    } else if ("binary".equalsIgnoreCase(type)) {
+      return Types.BINARY;
     } else if (type.startsWith("map<")) {
       return Types.VARCHAR;
     } else if (type.startsWith("array<")) {

Modified: hive/branches/HIVE-4115/jdbc/src/test/org/apache/hive/jdbc/TestJdbcDriver2.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/jdbc/src/test/org/apache/hive/jdbc/TestJdbcDriver2.java?rev=1464915&r1=1464914&r2=1464915&view=diff
==============================================================================
--- hive/branches/HIVE-4115/jdbc/src/test/org/apache/hive/jdbc/TestJdbcDriver2.java (original)
+++ hive/branches/HIVE-4115/jdbc/src/test/org/apache/hive/jdbc/TestJdbcDriver2.java Fri Apr  5 10:34:08 2013
@@ -145,7 +145,8 @@ public class TestJdbcDriver2 extends Tes
         + " c15 struct<r:int,s:struct<a:int,b:string>>,"
         + " c16 array<struct<m:map<string,string>,n:int>>,"
         + " c17 timestamp, "
-        + " c18 decimal) comment'" + dataTypeTableComment
+        + " c18 decimal, "
+        + " c19 binary) comment'" + dataTypeTableComment
             +"' partitioned by (dt STRING)");
 
     stmt.execute("load data local inpath '"
@@ -408,6 +409,9 @@ public class TestJdbcDriver2 extends Tes
     assertEquals(null, res.getString(14));
     assertEquals(null, res.getString(15));
     assertEquals(null, res.getString(16));
+    assertEquals(null, res.getString(17));
+    assertEquals(null, res.getString(18));
+    assertEquals(null, res.getString(19));
 
     // row 2
     assertTrue(res.next());
@@ -418,18 +422,19 @@ public class TestJdbcDriver2 extends Tes
     assertEquals("[]", res.getString(5));
     assertEquals("{}", res.getString(6));
     assertEquals("{}", res.getString(7));
-    assertEquals("[null, null, null]", res.getString(8));
+    assertEquals("{\"r\":null,\"s\":null,\"t\":null}", res.getString(8));
     assertEquals(-1, res.getByte(9));
     assertEquals(-1, res.getShort(10));
     assertEquals(-1.0f, res.getFloat(11));
     assertEquals(-1, res.getLong(12));
     assertEquals("[]", res.getString(13));
     assertEquals("{}", res.getString(14));
-    assertEquals("[null, null]", res.getString(15));
+    assertEquals("{\"r\":null,\"s\":null}", res.getString(15));
     assertEquals("[]", res.getString(16));
     assertEquals(null, res.getString(17));
     assertEquals(null, res.getTimestamp(17));
     assertEquals(null, res.getBigDecimal(18));
+    assertEquals(null, res.getString(19));
 
     // row 3
     assertTrue(res.next());
@@ -437,21 +442,22 @@ public class TestJdbcDriver2 extends Tes
     assertEquals(true, res.getBoolean(2));
     assertEquals(1.1d, res.getDouble(3));
     assertEquals("1", res.getString(4));
-    assertEquals("[1, 2]", res.getString(5));
-    assertEquals("{1=x, 2=y}", res.getString(6));
-    assertEquals("{k=v}", res.getString(7));
-    assertEquals("[a, 9, 2.2]", res.getString(8));
+    assertEquals("[1,2]", res.getString(5));
+    assertEquals("{1:\"x\",2:\"y\"}", res.getString(6));
+    assertEquals("{\"k\":\"v\"}", res.getString(7));
+    assertEquals("{\"r\":\"a\",\"s\":9,\"t\":2.2}", res.getString(8));
     assertEquals(1, res.getByte(9));
     assertEquals(1, res.getShort(10));
     assertEquals(1.0f, res.getFloat(11));
     assertEquals(1, res.getLong(12));
-    assertEquals("[[a, b], [c, d]]", res.getString(13));
-    assertEquals("{1={11=12, 13=14}, 2={21=22}}", res.getString(14));
-    assertEquals("[1, [2, x]]", res.getString(15));
-    assertEquals("[[{}, 1], [{c=d, a=b}, 2]]", res.getString(16));
+    assertEquals("[[\"a\",\"b\"],[\"c\",\"d\"]]", res.getString(13));
+    assertEquals("{1:{11:12,13:14},2:{21:22}}", res.getString(14));
+    assertEquals("{\"r\":1,\"s\":{\"a\":2,\"b\":\"x\"}}", res.getString(15));
+    assertEquals("[{\"m\":{},\"n\":1},{\"m\":{\"a\":\"b\",\"c\":\"d\"},\"n\":2}]", res.getString(16));
     assertEquals("2012-04-22 09:00:00.123456789", res.getString(17));
     assertEquals("2012-04-22 09:00:00.123456789", res.getTimestamp(17).toString());
     assertEquals("123456789.0123456", res.getBigDecimal(18).toString());
+    assertEquals("abcd", res.getString(19));
 
     // test getBoolean rules on non-boolean columns
     assertEquals(true, res.getBoolean(1));

Modified: hive/branches/HIVE-4115/ql/build.xml
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/ql/build.xml?rev=1464915&r1=1464914&r2=1464915&view=diff
==============================================================================
--- hive/branches/HIVE-4115/ql/build.xml (original)
+++ hive/branches/HIVE-4115/ql/build.xml Fri Apr  5 10:34:08 2013
@@ -247,6 +247,24 @@
       </patternset>
     </unzip>
 
+    <unzip 
+      src="${build.ivy.lib.dir}/default/protobuf-java-${protobuf.version}.jar" 
+      dest="${build.dir.hive}/protobuf-java/classes">
+      <patternset>
+        <exclude name="META-INF"/>
+        <exclude name="META-INF/MANIFEST.MF"/>
+      </patternset>
+    </unzip>
+
+    <unzip 
+      src="${build.ivy.lib.dir}/default/snappy-${snappy.version}.jar" 
+      dest="${build.dir.hive}/snappy/classes">
+      <patternset>
+        <exclude name="META-INF"/>
+        <exclude name="META-INF/MANIFEST.MF"/>
+      </patternset>
+    </unzip>
+
     <!-- jar jarfile="${build.dir}/hive_${name}.jar" basedir="${build.classes}" / -->
     <jar jarfile="${build.dir}/hive-exec-${version}.jar">
       <fileset dir="${build.dir.hive}/common/classes" includes="**/*.class"/>
@@ -260,6 +278,10 @@
       <fileset dir="${build.dir.hive}/shims/classes" includes="**/*.class"/>
       <fileset dir="${build.dir.hive}/javaewah/classes" includes="**/*.class"/>
       <fileset dir="${build.dir.hive}/javolution/classes" includes="**/*.class"/>
+      <fileset dir="${build.dir.hive}/protobuf-java/classes" 
+               includes="**/*.class"/>
+      <fileset dir="${build.dir.hive}/snappy/classes" 
+               includes="**/*.class"/>
       <manifest>
         <!-- Not putting these in their own manifest section, since that inserts
              a new-line, which breaks the reading of the attributes. -->

Modified: hive/branches/HIVE-4115/ql/if/queryplan.thrift
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/ql/if/queryplan.thrift?rev=1464915&r1=1464914&r2=1464915&view=diff
==============================================================================
--- hive/branches/HIVE-4115/ql/if/queryplan.thrift (original)
+++ hive/branches/HIVE-4115/ql/if/queryplan.thrift Fri Apr  5 10:34:08 2013
@@ -53,6 +53,7 @@ enum OperatorType {
   LATERALVIEWFORWARD,
   HASHTABLESINK,
   HASHTABLEDUMMY,
+  PTF,
 }
 
 struct Operator {

Modified: hive/branches/HIVE-4115/ql/src/gen/thrift/gen-cpp/queryplan_types.cpp
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/ql/src/gen/thrift/gen-cpp/queryplan_types.cpp?rev=1464915&r1=1464914&r2=1464915&view=diff
==============================================================================
--- hive/branches/HIVE-4115/ql/src/gen/thrift/gen-cpp/queryplan_types.cpp (original)
+++ hive/branches/HIVE-4115/ql/src/gen/thrift/gen-cpp/queryplan_types.cpp Fri Apr  5 10:34:08 2013
@@ -48,7 +48,8 @@ int _kOperatorTypeValues[] = {
   OperatorType::LATERALVIEWJOIN,
   OperatorType::LATERALVIEWFORWARD,
   OperatorType::HASHTABLESINK,
-  OperatorType::HASHTABLEDUMMY
+  OperatorType::HASHTABLEDUMMY,
+  OperatorType::PTF
 };
 const char* _kOperatorTypeNames[] = {
   "JOIN",
@@ -68,9 +69,10 @@ const char* _kOperatorTypeNames[] = {
   "LATERALVIEWJOIN",
   "LATERALVIEWFORWARD",
   "HASHTABLESINK",
-  "HASHTABLEDUMMY"
+  "HASHTABLEDUMMY",
+  "PTF"
 };
-const std::map<int, const char*> _OperatorType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(18, _kOperatorTypeValues, _kOperatorTypeNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL));
+const std::map<int, const char*> _OperatorType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(19, _kOperatorTypeValues, _kOperatorTypeNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL));
 
 int _kTaskTypeValues[] = {
   TaskType::MAP,

Modified: hive/branches/HIVE-4115/ql/src/gen/thrift/gen-cpp/queryplan_types.h
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/ql/src/gen/thrift/gen-cpp/queryplan_types.h?rev=1464915&r1=1464914&r2=1464915&view=diff
==============================================================================
--- hive/branches/HIVE-4115/ql/src/gen/thrift/gen-cpp/queryplan_types.h (original)
+++ hive/branches/HIVE-4115/ql/src/gen/thrift/gen-cpp/queryplan_types.h Fri Apr  5 10:34:08 2013
@@ -53,7 +53,8 @@ struct OperatorType {
     LATERALVIEWJOIN = 14,
     LATERALVIEWFORWARD = 15,
     HASHTABLESINK = 16,
-    HASHTABLEDUMMY = 17
+    HASHTABLEDUMMY = 17,
+    PTF = 18
   };
 };
 

Modified: hive/branches/HIVE-4115/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Operator.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Operator.java?rev=1464915&r1=1464914&r2=1464915&view=diff
==============================================================================
--- hive/branches/HIVE-4115/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Operator.java (original)
+++ hive/branches/HIVE-4115/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Operator.java Fri Apr  5 10:34:08 2013
@@ -810,7 +810,7 @@ public class Operator implements org.apa
                 for (int _i25 = 0; _i25 < _map24.size; ++_i25)
                 {
                   String _key26; // required
-                  String _val27; // optional
+                  String _val27; // required
                   _key26 = iprot.readString();
                   _val27 = iprot.readString();
                   struct.operatorAttributes.put(_key26, _val27);
@@ -830,7 +830,7 @@ public class Operator implements org.apa
                 for (int _i29 = 0; _i29 < _map28.size; ++_i29)
                 {
                   String _key30; // required
-                  long _val31; // optional
+                  long _val31; // required
                   _key30 = iprot.readString();
                   _val31 = iprot.readI64();
                   struct.operatorCounters.put(_key30, _val31);
@@ -1003,7 +1003,7 @@ public class Operator implements org.apa
           for (int _i37 = 0; _i37 < _map36.size; ++_i37)
           {
             String _key38; // required
-            String _val39; // optional
+            String _val39; // required
             _key38 = iprot.readString();
             _val39 = iprot.readString();
             struct.operatorAttributes.put(_key38, _val39);
@@ -1018,7 +1018,7 @@ public class Operator implements org.apa
           for (int _i41 = 0; _i41 < _map40.size; ++_i41)
           {
             String _key42; // required
-            long _val43; // optional
+            long _val43; // required
             _key42 = iprot.readString();
             _val43 = iprot.readI64();
             struct.operatorCounters.put(_key42, _val43);

Modified: hive/branches/HIVE-4115/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/OperatorType.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/OperatorType.java?rev=1464915&r1=1464914&r2=1464915&view=diff
==============================================================================
--- hive/branches/HIVE-4115/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/OperatorType.java (original)
+++ hive/branches/HIVE-4115/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/OperatorType.java Fri Apr  5 10:34:08 2013
@@ -29,7 +29,8 @@ public enum OperatorType implements org.
   LATERALVIEWJOIN(14),
   LATERALVIEWFORWARD(15),
   HASHTABLESINK(16),
-  HASHTABLEDUMMY(17);
+  HASHTABLEDUMMY(17),
+  PTF(18);
 
   private final int value;
 
@@ -86,6 +87,8 @@ public enum OperatorType implements org.
         return HASHTABLESINK;
       case 17:
         return HASHTABLEDUMMY;
+      case 18:
+        return PTF;
       default:
         return null;
     }

Modified: hive/branches/HIVE-4115/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Query.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Query.java?rev=1464915&r1=1464914&r2=1464915&view=diff
==============================================================================
--- hive/branches/HIVE-4115/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Query.java (original)
+++ hive/branches/HIVE-4115/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Query.java Fri Apr  5 10:34:08 2013
@@ -983,7 +983,7 @@ public class Query implements org.apache
                 for (int _i101 = 0; _i101 < _map100.size; ++_i101)
                 {
                   String _key102; // required
-                  String _val103; // optional
+                  String _val103; // required
                   _key102 = iprot.readString();
                   _val103 = iprot.readString();
                   struct.queryAttributes.put(_key102, _val103);
@@ -1003,7 +1003,7 @@ public class Query implements org.apache
                 for (int _i105 = 0; _i105 < _map104.size; ++_i105)
                 {
                   String _key106; // required
-                  long _val107; // optional
+                  long _val107; // required
                   _key106 = iprot.readString();
                   _val107 = iprot.readI64();
                   struct.queryCounters.put(_key106, _val107);
@@ -1239,7 +1239,7 @@ public class Query implements org.apache
           for (int _i118 = 0; _i118 < _map117.size; ++_i118)
           {
             String _key119; // required
-            String _val120; // optional
+            String _val120; // required
             _key119 = iprot.readString();
             _val120 = iprot.readString();
             struct.queryAttributes.put(_key119, _val120);
@@ -1254,7 +1254,7 @@ public class Query implements org.apache
           for (int _i122 = 0; _i122 < _map121.size; ++_i122)
           {
             String _key123; // required
-            long _val124; // optional
+            long _val124; // required
             _key123 = iprot.readString();
             _val124 = iprot.readI64();
             struct.queryCounters.put(_key123, _val124);

Modified: hive/branches/HIVE-4115/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Stage.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Stage.java?rev=1464915&r1=1464914&r2=1464915&view=diff
==============================================================================
--- hive/branches/HIVE-4115/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Stage.java (original)
+++ hive/branches/HIVE-4115/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Stage.java Fri Apr  5 10:34:08 2013
@@ -911,7 +911,7 @@ public class Stage implements org.apache
                 for (int _i73 = 0; _i73 < _map72.size; ++_i73)
                 {
                   String _key74; // required
-                  String _val75; // optional
+                  String _val75; // required
                   _key74 = iprot.readString();
                   _val75 = iprot.readString();
                   struct.stageAttributes.put(_key74, _val75);
@@ -931,7 +931,7 @@ public class Stage implements org.apache
                 for (int _i77 = 0; _i77 < _map76.size; ++_i77)
                 {
                   String _key78; // required
-                  long _val79; // optional
+                  long _val79; // required
                   _key78 = iprot.readString();
                   _val79 = iprot.readI64();
                   struct.stageCounters.put(_key78, _val79);
@@ -1147,7 +1147,7 @@ public class Stage implements org.apache
           for (int _i90 = 0; _i90 < _map89.size; ++_i90)
           {
             String _key91; // required
-            String _val92; // optional
+            String _val92; // required
             _key91 = iprot.readString();
             _val92 = iprot.readString();
             struct.stageAttributes.put(_key91, _val92);
@@ -1162,7 +1162,7 @@ public class Stage implements org.apache
           for (int _i94 = 0; _i94 < _map93.size; ++_i94)
           {
             String _key95; // required
-            long _val96; // optional
+            long _val96; // required
             _key95 = iprot.readString();
             _val96 = iprot.readI64();
             struct.stageCounters.put(_key95, _val96);

Modified: hive/branches/HIVE-4115/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Task.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Task.java?rev=1464915&r1=1464914&r2=1464915&view=diff
==============================================================================
--- hive/branches/HIVE-4115/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Task.java (original)
+++ hive/branches/HIVE-4115/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Task.java Fri Apr  5 10:34:08 2013
@@ -996,7 +996,7 @@ public class Task implements org.apache.
                 for (int _i45 = 0; _i45 < _map44.size; ++_i45)
                 {
                   String _key46; // required
-                  String _val47; // optional
+                  String _val47; // required
                   _key46 = iprot.readString();
                   _val47 = iprot.readString();
                   struct.taskAttributes.put(_key46, _val47);
@@ -1016,7 +1016,7 @@ public class Task implements org.apache.
                 for (int _i49 = 0; _i49 < _map48.size; ++_i49)
                 {
                   String _key50; // required
-                  long _val51; // optional
+                  long _val51; // required
                   _key50 = iprot.readString();
                   _val51 = iprot.readI64();
                   struct.taskCounters.put(_key50, _val51);
@@ -1256,7 +1256,7 @@ public class Task implements org.apache.
           for (int _i62 = 0; _i62 < _map61.size; ++_i62)
           {
             String _key63; // required
-            String _val64; // optional
+            String _val64; // required
             _key63 = iprot.readString();
             _val64 = iprot.readString();
             struct.taskAttributes.put(_key63, _val64);
@@ -1271,7 +1271,7 @@ public class Task implements org.apache.
           for (int _i66 = 0; _i66 < _map65.size; ++_i66)
           {
             String _key67; // required
-            long _val68; // optional
+            long _val68; // required
             _key67 = iprot.readString();
             _val68 = iprot.readI64();
             struct.taskCounters.put(_key67, _val68);

Modified: hive/branches/HIVE-4115/ql/src/gen/thrift/gen-php/Types.php
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/ql/src/gen/thrift/gen-php/Types.php?rev=1464915&r1=1464914&r2=1464915&view=diff
==============================================================================
--- hive/branches/HIVE-4115/ql/src/gen/thrift/gen-php/Types.php (original)
+++ hive/branches/HIVE-4115/ql/src/gen/thrift/gen-php/Types.php Fri Apr  5 10:34:08 2013
@@ -53,6 +53,7 @@ final class OperatorType {
   const LATERALVIEWFORWARD = 15;
   const HASHTABLESINK = 16;
   const HASHTABLEDUMMY = 17;
+  const PTF = 18;
   static public $__names = array(
     0 => 'JOIN',
     1 => 'MAPJOIN',
@@ -72,6 +73,7 @@ final class OperatorType {
     15 => 'LATERALVIEWFORWARD',
     16 => 'HASHTABLESINK',
     17 => 'HASHTABLEDUMMY',
+    18 => 'PTF',
   );
 }
 

Modified: hive/branches/HIVE-4115/ql/src/gen/thrift/gen-py/queryplan/ttypes.py
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/ql/src/gen/thrift/gen-py/queryplan/ttypes.py?rev=1464915&r1=1464914&r2=1464915&view=diff
==============================================================================
--- hive/branches/HIVE-4115/ql/src/gen/thrift/gen-py/queryplan/ttypes.py (original)
+++ hive/branches/HIVE-4115/ql/src/gen/thrift/gen-py/queryplan/ttypes.py Fri Apr  5 10:34:08 2013
@@ -63,6 +63,7 @@ class OperatorType:
   LATERALVIEWFORWARD = 15
   HASHTABLESINK = 16
   HASHTABLEDUMMY = 17
+  PTF = 18
 
   _VALUES_TO_NAMES = {
     0: "JOIN",
@@ -83,6 +84,7 @@ class OperatorType:
     15: "LATERALVIEWFORWARD",
     16: "HASHTABLESINK",
     17: "HASHTABLEDUMMY",
+    18: "PTF",
   }
 
   _NAMES_TO_VALUES = {
@@ -104,6 +106,7 @@ class OperatorType:
     "LATERALVIEWFORWARD": 15,
     "HASHTABLESINK": 16,
     "HASHTABLEDUMMY": 17,
+    "PTF": 18,
   }
 
 class TaskType:

Modified: hive/branches/HIVE-4115/ql/src/gen/thrift/gen-rb/queryplan_types.rb
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/ql/src/gen/thrift/gen-rb/queryplan_types.rb?rev=1464915&r1=1464914&r2=1464915&view=diff
==============================================================================
--- hive/branches/HIVE-4115/ql/src/gen/thrift/gen-rb/queryplan_types.rb (original)
+++ hive/branches/HIVE-4115/ql/src/gen/thrift/gen-rb/queryplan_types.rb Fri Apr  5 10:34:08 2013
@@ -39,8 +39,9 @@ module OperatorType
   LATERALVIEWFORWARD = 15
   HASHTABLESINK = 16
   HASHTABLEDUMMY = 17
-  VALUE_MAP = {0 => "JOIN", 1 => "MAPJOIN", 2 => "EXTRACT", 3 => "FILTER", 4 => "FORWARD", 5 => "GROUPBY", 6 => "LIMIT", 7 => "SCRIPT", 8 => "SELECT", 9 => "TABLESCAN", 10 => "FILESINK", 11 => "REDUCESINK", 12 => "UNION", 13 => "UDTF", 14 => "LATERALVIEWJOIN", 15 => "LATERALVIEWFORWARD", 16 => "HASHTABLESINK", 17 => "HASHTABLEDUMMY"}
-  VALID_VALUES = Set.new([JOIN, MAPJOIN, EXTRACT, FILTER, FORWARD, GROUPBY, LIMIT, SCRIPT, SELECT, TABLESCAN, FILESINK, REDUCESINK, UNION, UDTF, LATERALVIEWJOIN, LATERALVIEWFORWARD, HASHTABLESINK, HASHTABLEDUMMY]).freeze
+  PTF = 18
+  VALUE_MAP = {0 => "JOIN", 1 => "MAPJOIN", 2 => "EXTRACT", 3 => "FILTER", 4 => "FORWARD", 5 => "GROUPBY", 6 => "LIMIT", 7 => "SCRIPT", 8 => "SELECT", 9 => "TABLESCAN", 10 => "FILESINK", 11 => "REDUCESINK", 12 => "UNION", 13 => "UDTF", 14 => "LATERALVIEWJOIN", 15 => "LATERALVIEWFORWARD", 16 => "HASHTABLESINK", 17 => "HASHTABLEDUMMY", 18 => "PTF"}
+  VALID_VALUES = Set.new([JOIN, MAPJOIN, EXTRACT, FILTER, FORWARD, GROUPBY, LIMIT, SCRIPT, SELECT, TABLESCAN, FILESINK, REDUCESINK, UNION, UDTF, LATERALVIEWJOIN, LATERALVIEWFORWARD, HASHTABLESINK, HASHTABLEDUMMY, PTF]).freeze
 end
 
 module TaskType

Modified: hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java?rev=1464915&r1=1464914&r2=1464915&view=diff
==============================================================================
--- hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java (original)
+++ hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java Fri Apr  5 10:34:08 2013
@@ -236,8 +236,8 @@ public enum ErrorMsg {
     "Fix the metadata or don't use bucketed mapjoin, by setting " +
     "hive.enforce.bucketmapjoin to false."),
 
-  JOINNODE_OUTERJOIN_MORETHAN_32(10142, "Single join node containing outer join(s) " +
-      "cannot have more than 32 aliases"),
+  JOINNODE_OUTERJOIN_MORETHAN_16(10142, "Single join node containing outer join(s) " +
+      "cannot have more than 16 aliases"),
 
   INVALID_JDO_FILTER_EXPRESSION(10043, "Invalid expression for JDO filter"),
 

Modified: hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/QueryProperties.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/QueryProperties.java?rev=1464915&r1=1464914&r2=1464915&view=diff
==============================================================================
--- hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/QueryProperties.java (original)
+++ hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/QueryProperties.java Fri Apr  5 10:34:08 2013
@@ -37,6 +37,8 @@ public class QueryProperties {
   boolean hasOrderBy = false;
   boolean hasSortBy = false;
   boolean hasJoinFollowedByGroupBy = false;
+  boolean hasPTF = false;
+  boolean hasWindowing = false;
 
   // does the query have a using clause
   boolean usesScript = false;
@@ -44,6 +46,7 @@ public class QueryProperties {
   boolean hasDistributeBy = false;
   boolean hasClusterBy = false;
   boolean mapJoinRemoved = false;
+  boolean hasMapGroupBy = false;
 
   public boolean hasJoin() {
     return hasJoin;
@@ -109,6 +112,22 @@ public class QueryProperties {
     this.hasClusterBy = hasClusterBy;
   }
 
+  public boolean hasPTF() {
+    return hasPTF;
+  }
+
+  public void setHasPTF(boolean hasPTF) {
+    this.hasPTF = hasPTF;
+  }
+
+  public boolean hasWindowing() {
+    return hasWindowing;
+  }
+
+  public void setHasWindowing(boolean hasWindowing) {
+    this.hasWindowing = hasWindowing;
+  }
+
   public boolean isMapJoinRemoved() {
     return mapJoinRemoved;
   }
@@ -116,4 +135,12 @@ public class QueryProperties {
   public void setMapJoinRemoved(boolean mapJoinRemoved) {
     this.mapJoinRemoved = mapJoinRemoved;
   }
+
+  public boolean isHasMapGroupBy() {
+    return hasMapGroupBy;
+  }
+
+  public void setHasMapGroupBy(boolean hasMapGroupBy) {
+    this.hasMapGroupBy = hasMapGroupBy;
+  }
 }

Modified: hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/exec/ColumnStatsTask.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/exec/ColumnStatsTask.java?rev=1464915&r1=1464914&r2=1464915&view=diff
==============================================================================
--- hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/exec/ColumnStatsTask.java (original)
+++ hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/exec/ColumnStatsTask.java Fri Apr  5 10:34:08 2013
@@ -61,6 +61,8 @@ import org.apache.hadoop.util.StringUtil
 public class ColumnStatsTask extends Task<ColumnStatsWork> implements Serializable {
   private static final long serialVersionUID = 1L;
   private FetchOperator ftOp;
+  private int totalRows;
+  private int numRows = 0;
   private static transient final Log LOG = LogFactory.getLog(ColumnStatsTask.class);
 
   public ColumnStatsTask() {
@@ -70,6 +72,7 @@ public class ColumnStatsTask extends Tas
   @Override
   public void initialize(HiveConf conf, QueryPlan queryPlan, DriverContext ctx) {
     super.initialize(conf, queryPlan, ctx);
+    work.initializeForFetch();
     try {
       JobConf job = new JobConf(conf, ExecDriver.class);
       ftOp = new FetchOperator(work.getfWork(), job);
@@ -294,14 +297,16 @@ public class ColumnStatsTask extends Tas
       e.printStackTrace();
     }
 
-    // Construct a column statistics object from the result
-    ColumnStatistics colStats = constructColumnStatsFromPackedRow(io.oi, io.o);
-
-    // Persist the column statistics object to the metastore
-    try {
-      db.updatePartitionColumnStatistics(colStats);
-    } catch (Exception e) {
-      e.printStackTrace();
+    if (io != null) {
+      // Construct a column statistics object from the result
+      ColumnStatistics colStats = constructColumnStatsFromPackedRow(io.oi, io.o);
+
+      // Persist the column statistics object to the metastore
+      try {
+        db.updatePartitionColumnStatistics(colStats);
+      } catch (Exception e) {
+        e.printStackTrace();
+      }
     }
     return 0;
   }
@@ -317,14 +322,16 @@ public class ColumnStatsTask extends Tas
       e.printStackTrace();
     }
 
-    // Construct a column statistics object from the result
-    ColumnStatistics colStats = constructColumnStatsFromPackedRow(io.oi, io.o);
-
-    // Persist the column statistics object to the metastore
-    try {
-      db.updateTableColumnStatistics(colStats);
-    } catch (Exception e) {
-      e.printStackTrace();
+    if (io != null) {
+      // Construct a column statistics object from the result
+      ColumnStatistics colStats = constructColumnStatsFromPackedRow(io.oi, io.o);
+
+      // Persist the column statistics object to the metastore
+      try {
+        db.updateTableColumnStatistics(colStats);
+      } catch (Exception e) {
+        e.printStackTrace();
+      }
     }
     return 0;
   }
@@ -344,10 +351,25 @@ public class ColumnStatsTask extends Tas
   }
 
   private InspectableObject fetchColumnStats() throws IOException, CommandNeedRetryException {
+    InspectableObject io = null;
+
     try {
-      InspectableObject io = ftOp.getNextRow();
-      if (io == null) {
-        throw new CommandNeedRetryException();
+      int rowsRet = work.getLeastNumRows();
+      if (rowsRet <= 0) {
+        rowsRet = ColumnStatsWork.getLimit() >= 0 ?
+            Math.min(ColumnStatsWork.getLimit() - totalRows, 1) : 1;
+      }
+      if (rowsRet <= 0) {
+        ftOp.clearFetchContext();
+        return null;
+      }
+      while (numRows < rowsRet) {
+        if ((io = ftOp.getNextRow()) == null) {
+          if (work.getLeastNumRows() > 0) {
+            throw new CommandNeedRetryException();
+          }
+        }
+        numRows++;
       }
       return io;
     } catch (CommandNeedRetryException e) {

Modified: hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/exec/FetchOperator.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/exec/FetchOperator.java?rev=1464915&r1=1464914&r2=1464915&view=diff
==============================================================================
--- hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/exec/FetchOperator.java (original)
+++ hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/exec/FetchOperator.java Fri Apr  5 10:34:08 2013
@@ -102,6 +102,7 @@ public class FetchOperator implements Se
   private transient Path currPath;
   private transient StructObjectInspector objectInspector;
   private transient StructObjectInspector rowObjectInspector;
+  private transient ObjectInspector partitionedTableOI;
   private transient Object[] row;
 
   public FetchOperator() {
@@ -400,7 +401,7 @@ public class FetchOperator implements Se
 
       ObjectInspector outputOI = ObjectInspectorConverters.getConvertedOI(
           serde.getObjectInspector(),
-          tblSerde.getObjectInspector());
+          partitionedTableOI == null ? tblSerde.getObjectInspector() : partitionedTableOI);
 
       partTblObjectInspectorConverter = ObjectInspectorConverters.getConverter(
           serde.getObjectInspector(), outputOI);
@@ -610,14 +611,22 @@ public class FetchOperator implements Se
       Deserializer tblSerde = partition.getTableDesc().getDeserializerClass().newInstance();
       tblSerde.initialize(job, partition.getTableDesc().getProperties());
 
-      Deserializer partSerde = partition.getDeserializerClass().newInstance();
-      partSerde.initialize(job, partition.getProperties());
+      partitionedTableOI = null;
+      ObjectInspector tableOI = tblSerde.getObjectInspector();
 
-      ObjectInspector partitionOI = ObjectInspectorConverters.getConvertedOI(
-          partSerde.getObjectInspector(),
-          tblSerde.getObjectInspector());
-
-      return getRowInspectorFromPartition(partition, partitionOI);
+      // Get the OI corresponding to all the partitions
+      for (PartitionDesc listPart : listParts) {
+        partition = listPart;
+        Deserializer partSerde = listPart.getDeserializerClass().newInstance();
+        partSerde.initialize(job, listPart.getProperties());
+
+        partitionedTableOI = ObjectInspectorConverters.getConvertedOI(
+            partSerde.getObjectInspector(), tableOI);
+        if (!partitionedTableOI.equals(tableOI)) {
+          break;
+        }
+      }
+      return getRowInspectorFromPartition(partition, partitionedTableOI);
     } catch (Exception e) {
       throw new HiveException("Failed with exception " + e.getMessage()
           + org.apache.hadoop.util.StringUtils.stringifyException(e));

Modified: hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java?rev=1464915&r1=1464914&r2=1464915&view=diff
==============================================================================
--- hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java (original)
+++ hive/branches/HIVE-4115/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java Fri Apr  5 10:34:08 2013
@@ -135,15 +135,25 @@ import org.apache.hadoop.hive.ql.udf.gen
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFCount;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFCovariance;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFCovarianceSample;
+import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFCumeDist;
+import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFDenseRank;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEWAHBitmap;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator;
+import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFFirstValue;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFHistogramNumeric;
+import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFLastValue;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFMax;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFMin;
+import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFNTile;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFParameterInfo;
+import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFPercentRank;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFPercentileApprox;
+import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFRank;
+import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFLead;
+import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFLag;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFResolver;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFResolver2;
+import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFRowNumber;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFStd;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFStdSample;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFSum;
@@ -172,6 +182,8 @@ import org.apache.hadoop.hive.ql.udf.gen
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDFInFile;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDFIndex;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDFInstr;
+import org.apache.hadoop.hive.ql.udf.generic.GenericUDFLeadLag.GenericUDFLag;
+import org.apache.hadoop.hive.ql.udf.generic.GenericUDFLeadLag.GenericUDFLead;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDFLocate;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDFMap;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDFMapKeys;
@@ -201,8 +213,8 @@ import org.apache.hadoop.hive.ql.udf.gen
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDFStruct;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDFTimestamp;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDFToBinary;
-import org.apache.hadoop.hive.ql.udf.generic.GenericUDFToUnixTimeStamp;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDFToDecimal;
+import org.apache.hadoop.hive.ql.udf.generic.GenericUDFToUnixTimeStamp;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDFToUtcTimestamp;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDFTranslate;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDFUnion;
@@ -215,6 +227,11 @@ import org.apache.hadoop.hive.ql.udf.gen
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDTFParseUrlTuple;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDTFStack;
 import org.apache.hadoop.hive.ql.udf.generic.SimpleGenericUDAFParameterInfo;
+import org.apache.hadoop.hive.ql.udf.ptf.NPath.NPathResolver;
+import org.apache.hadoop.hive.ql.udf.ptf.Noop.NoopResolver;
+import org.apache.hadoop.hive.ql.udf.ptf.NoopWithMap.NoopWithMapResolver;
+import org.apache.hadoop.hive.ql.udf.ptf.TableFunctionResolver;
+import org.apache.hadoop.hive.ql.udf.ptf.WindowingTableFunction.WindowingTableFunctionResolver;
 import org.apache.hadoop.hive.ql.udf.xml.GenericUDFXPath;
 import org.apache.hadoop.hive.ql.udf.xml.UDFXPathBoolean;
 import org.apache.hadoop.hive.ql.udf.xml.UDFXPathDouble;
@@ -237,6 +254,7 @@ import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
 
+
 /**
  * FunctionRegistry.
  */
@@ -248,6 +266,26 @@ public final class FunctionRegistry {
    * The mapping from expression function names to expression classes.
    */
   static Map<String, FunctionInfo> mFunctions = Collections.synchronizedMap(new LinkedHashMap<String, FunctionInfo>());
+
+  /*
+   * PTF variables
+   * */
+
+  public static final String LEAD_FUNC_NAME = "lead";
+  public static final String LAG_FUNC_NAME = "lag";
+
+  public static final String WINDOWING_TABLE_FUNCTION = "windowingtablefunction";
+  public static final String NOOP_TABLE_FUNCTION = "noop";
+  public static final String NOOP_MAP_TABLE_FUNCTION = "noopwithmap";
+
+  static Map<String, PTFFunctionInfo> tableFunctions = Collections.synchronizedMap(new LinkedHashMap<String, PTFFunctionInfo>());
+  static Map<String, WindowFunctionInfo> windowFunctions = Collections.synchronizedMap(new LinkedHashMap<String, WindowFunctionInfo>());
+
+  /*
+   * UDAFS that only work when the input rows have an order.
+   */
+  public static final HashSet<String> UDAFS_IMPLY_ORDER = new HashSet<String>();
+
   static {
     registerUDF("concat", UDFConcat.class, false);
     registerUDF("substr", UDFSubstr.class, false);
@@ -482,6 +520,36 @@ public final class FunctionRegistry {
     registerGenericUDTF("json_tuple", GenericUDTFJSONTuple.class);
     registerGenericUDTF("parse_url_tuple", GenericUDTFParseUrlTuple.class);
     registerGenericUDTF("stack", GenericUDTFStack.class);
+
+    //PTF declarations
+    registerGenericUDF(true, LEAD_FUNC_NAME, GenericUDFLead.class);
+    registerGenericUDF(true, LAG_FUNC_NAME, GenericUDFLag.class);
+
+    registerHiveUDAFsAsWindowFunctions();
+    registerWindowFunction("row_number", new GenericUDAFRowNumber());
+    registerWindowFunction("rank", new GenericUDAFRank());
+    registerWindowFunction("dense_rank", new GenericUDAFDenseRank());
+    registerWindowFunction("percent_rank", new GenericUDAFPercentRank());
+    registerWindowFunction("cume_dist", new GenericUDAFCumeDist());
+    registerWindowFunction("ntile", new GenericUDAFNTile());
+    registerWindowFunction("first_value", new GenericUDAFFirstValue());
+    registerWindowFunction("last_value", new GenericUDAFLastValue());
+    registerWindowFunction(LEAD_FUNC_NAME, new GenericUDAFLead(), false);
+    registerWindowFunction(LAG_FUNC_NAME, new GenericUDAFLag(), false);
+
+    UDAFS_IMPLY_ORDER.add("rank");
+    UDAFS_IMPLY_ORDER.add("dense_rank");
+    UDAFS_IMPLY_ORDER.add("percent_rank");
+    UDAFS_IMPLY_ORDER.add("cume_dist");
+    UDAFS_IMPLY_ORDER.add(LEAD_FUNC_NAME);
+    UDAFS_IMPLY_ORDER.add(LAG_FUNC_NAME);
+    UDAFS_IMPLY_ORDER.add("first_value");
+    UDAFS_IMPLY_ORDER.add("last_value");
+
+    registerTableFunction(NOOP_TABLE_FUNCTION, NoopResolver.class);
+    registerTableFunction(NOOP_MAP_TABLE_FUNCTION, NoopWithMapResolver.class);
+    registerTableFunction(WINDOWING_TABLE_FUNCTION,  WindowingTableFunctionResolver.class);
+    registerTableFunction("npath", NPathResolver.class);
   }
 
   public static void registerTemporaryUDF(String functionName,
@@ -795,6 +863,26 @@ public final class FunctionRegistry {
     return udafEvaluator;
   }
 
+  @SuppressWarnings("deprecation")
+  public static GenericUDAFEvaluator getGenericWindowingEvaluator(String name,
+      List<ObjectInspector> argumentOIs, boolean isDistinct,
+      boolean isAllColumns) throws SemanticException {
+
+    WindowFunctionInfo finfo = windowFunctions.get(name.toLowerCase());
+    if (finfo == null) { return null;}
+    if ( !name.toLowerCase().equals(LEAD_FUNC_NAME) &&
+    !name.toLowerCase().equals(LAG_FUNC_NAME) ) {
+    return getGenericUDAFEvaluator(name, argumentOIs, isDistinct, isAllColumns);
+    }
+
+    // this must be lead/lag UDAF
+    ObjectInspector args[] = new ObjectInspector[argumentOIs.size()];
+    GenericUDAFResolver udafResolver = finfo.getfInfo().getGenericUDAFResolver();
+    GenericUDAFParameterInfo paramInfo = new SimpleGenericUDAFParameterInfo(
+    argumentOIs.toArray(args), isDistinct, isAllColumns);
+    return ((GenericUDAFResolver2) udafResolver).getEvaluator(paramInfo);
+  }
+
   /**
    * This method is shared between UDFRegistry and UDAFRegistry. methodName will
    * be "evaluate" for UDFRegistry, and "aggregate"/"evaluate"/"evaluatePartial"
@@ -1033,36 +1121,36 @@ public final class FunctionRegistry {
     }
     if (udfMethods.size() > 1) {
 
-      // if the only difference is numeric types, pick the method 
+      // if the only difference is numeric types, pick the method
       // with the smallest overall numeric type.
       int lowestNumericType = Integer.MAX_VALUE;
       boolean multiple = true;
       Method candidate = null;
       List<TypeInfo> referenceArguments = null;
-      
+
       for (Method m: udfMethods) {
         int maxNumericType = 0;
-        
+
         List<TypeInfo> argumentsAccepted = TypeInfoUtils.getParameterTypeInfos(m, argumentsPassed.size());
-        
+
         if (referenceArguments == null) {
-          // keep the arguments for reference - we want all the non-numeric 
+          // keep the arguments for reference - we want all the non-numeric
           // arguments to be the same
           referenceArguments = argumentsAccepted;
         }
-        
+
         Iterator<TypeInfo> referenceIterator = referenceArguments.iterator();
-        
+
         for (TypeInfo accepted: argumentsAccepted) {
           TypeInfo reference = referenceIterator.next();
-          
+
           if (numericTypes.containsKey(accepted)) {
             // We're looking for the udf with the smallest maximum numeric type.
             int typeValue = numericTypes.get(accepted);
             maxNumericType = typeValue > maxNumericType ? typeValue : maxNumericType;
           } else if (!accepted.equals(reference)) {
             // There are non-numeric arguments that don't match from one UDF to
-            // another. We give up at this point. 
+            // another. We give up at this point.
             throw new AmbiguousMethodException(udfClass, argumentsPassed, mlist);
           }
         }
@@ -1351,4 +1439,93 @@ public final class FunctionRegistry {
   private FunctionRegistry() {
     // prevent instantiation
   }
+
+
+  //---------PTF functions------------
+
+  public static void registerWindowFunction(String name, GenericUDAFResolver wFn)
+  {
+    registerWindowFunction(name, wFn, true);
+  }
+
+  /**
+   * Typically a WindowFunction is the same as a UDAF. The only exceptions are Lead & Lag UDAFs. These
+   * are not registered as regular UDAFs because
+   * - we plan to support Lead & Lag as UDFs (usable only within argument expressions
+   *   of UDAFs when windowing is involved). Since mFunctions holds both UDFs and UDAFs we cannot
+   *   add both FunctionInfos to mFunctions.
+   * We choose to only register UDFs in mFunctions. The implication of this is that Lead/Lag UDAFs
+   * are only usable when windowing is involved.
+   *
+   * @param name
+   * @param wFn
+   * @param registerAsUDAF
+   */
+  public static void registerWindowFunction(String name, GenericUDAFResolver wFn, boolean registerAsUDAF)
+  {
+    FunctionInfo fInfo = null;
+    if (registerAsUDAF) {
+      registerGenericUDAF(true, name, wFn);
+      fInfo = getFunctionInfo(name);
+    }
+    else {
+      fInfo = new FunctionInfo(true,
+          name.toLowerCase(), wFn);
+    }
+
+    WindowFunctionInfo wInfo = new WindowFunctionInfo(fInfo);
+    windowFunctions.put(name.toLowerCase(), wInfo);
+  }
+
+  public static WindowFunctionInfo getWindowFunctionInfo(String name)
+  {
+    return windowFunctions.get(name.toLowerCase());
+  }
+
+  public static boolean impliesOrder(String functionName) {
+    return functionName == null ? false : UDAFS_IMPLY_ORDER.contains(functionName.toLowerCase());
+  }
+
+  static void registerHiveUDAFsAsWindowFunctions()
+  {
+    Set<String> fNames = getFunctionNames();
+    for(String fName : fNames)
+    {
+      FunctionInfo fInfo = getFunctionInfo(fName);
+      if ( fInfo.isGenericUDAF())
+      {
+        WindowFunctionInfo wInfo = new WindowFunctionInfo(fInfo);
+        windowFunctions.put(fName, wInfo);
+      }
+    }
+  }
+
+  public static boolean isTableFunction(String name)
+  {
+    PTFFunctionInfo tFInfo = tableFunctions.get(name.toLowerCase());
+     return tFInfo != null && !tFInfo.isInternal();
+  }
+
+  public static TableFunctionResolver getTableFunctionResolver(String name)
+  {
+    PTFFunctionInfo tfInfo = tableFunctions.get(name.toLowerCase());
+    return (TableFunctionResolver) ReflectionUtils.newInstance(tfInfo.getFunctionResolver(), null);
+  }
+
+  public static TableFunctionResolver getWindowingTableFunction()
+  {
+    return getTableFunctionResolver(WINDOWING_TABLE_FUNCTION);
+  }
+
+  public static TableFunctionResolver getNoopTableFunction()
+  {
+    return getTableFunctionResolver(NOOP_TABLE_FUNCTION);
+  }
+
+  public static void registerTableFunction(String name, Class<? extends TableFunctionResolver> tFnCls)
+  {
+    PTFFunctionInfo tInfo = new PTFFunctionInfo(name, tFnCls);
+    tableFunctions.put(name.toLowerCase(), tInfo);
+  }
+
 }



Mime
View raw message