Hash function in spark

后端 未结 1 401
情深已故
情深已故 2021-01-11 11:17

I\'m trying to add a column to a dataframe, which will contain hash of another column.

I\'ve found this piece of documentation: https://spark.apache

相关标签:
1条回答
  • 2021-01-11 11:36

    It is Murmur based on the source code.

      /**
       * Calculates the hash code of given columns, and returns the result as an int column.
       *
       * @group misc_funcs
       * @since 2.0.0
       */
      @scala.annotation.varargs
      def hash(cols: Column*): Column = withExpr {
        new Murmur3Hash(cols.map(_.expr))
      }
    
    0 讨论(0)
提交回复
热议问题