Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-44058

Remove deprecated API usage in HiveShim.scala

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 3.4.0
    • None
    • Spark Submit
    • None

    Description

      Spark's HiveShim.scala calls this particular method in Hive :
      createPartitionMethod.invoke(
      hive,
      table,
      spec,
      location,
      params, // partParams
      null, // inputFormat
      null, // outputFormat
      -1: JInteger, // numBuckets
      null, // cols
      null, // serializationLib
      null, // serdeParams
      null, // bucketCols
      null) // sortCols
      }
       
      We do not have any such implementation of createPartition in Hive. We only have this definition :
      public Partition createPartition(Table tbl, Map<String, String> partSpec) throws HiveException {
          try

      {       org.apache.hadoop.hive.metastore.api.Partition part =           Partition.createMetaPartitionObject(tbl, partSpec, null);       AcidUtils.TableSnapshot tableSnapshot = AcidUtils.getTableSnapshot(conf, tbl);       part.setWriteId(tableSnapshot != null ? tableSnapshot.getWriteId() : 0);       return new Partition(tbl, getMSC().add_partition(part));     }

      catch (Exception e)

      {       LOG.error(StringUtils.stringifyException(e));       throw new HiveException(e);     }

        }
      The 12 parameter implementation was removed in HIVE-5951

       

      The issue is that this 12 parameter implementation of createPartition method was added in Hive-0.12 and then was removed in Hive-0.13. When Hive 0.12 was used in Spark, SPARK-15334 commit in Spark added this 12 parameters implementation. But after Hive migrated to newer APIs somehow this was not changed in Spark OSS and it looks to us like a Bug from the Spark end.

       

      We need to migrate to the newest implementation of Hive createPartition method otherwise this flow can break

      Attachments

        Activity

          People

            Unassigned Unassigned
            amanraj2520 Aman Raj
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: