Class SparkScalaUtils


  • public final class SparkScalaUtils
    extends java.lang.Object
    Utility methods for restricting Scala-ism in Spark code in a single class.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int getFieldIndex​(org.apache.spark.sql.types.StructType dataSchema, java.lang.String fieldName)
      Get the index of a field in a StructType.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getFieldIndex

        public static int getFieldIndex​(org.apache.spark.sql.types.StructType dataSchema,
                                        java.lang.String fieldName)
        Get the index of a field in a StructType. If the field does not exist, return -1.