HyukjinKwon commented on a change in pull request #25245: [SPARK-25382][SQL][PYSPARK] Remove ImageSchema.readImages in 3.0 URL: https://github.com/apache/spark/pull/25245#discussion_r307093160
########## File path: mllib/src/main/scala/org/apache/spark/ml/source/image/ImageFileFormat.scala ########## @@ -98,3 +103,163 @@ private[image] class ImageFileFormat extends FileFormat with DataSourceRegister } } } + +object ImageFileFormat { + + val undefinedImageType = "Undefined" + + /** + * (Scala-specific) OpenCV type mapping supported + */ + val ocvTypes: Map[String, Int] = Map( + undefinedImageType -> -1, + "CV_8U" -> 0, "CV_8UC1" -> 0, "CV_8UC3" -> 16, "CV_8UC4" -> 24 + ) + + /** + * (Java-specific) OpenCV type mapping supported + */ + val javaOcvTypes: java.util.Map[String, Int] = ocvTypes.asJava + + /** + * Schema for the image column: Row(String, Int, Int, Int, Int, Array[Byte]) + */ + private[image] val columnSchema = StructType( + StructField("origin", StringType, true) :: + StructField("height", IntegerType, true) :: + StructField("width", IntegerType, true) :: + StructField("nChannels", IntegerType, true) :: + // OpenCV-compatible type: CV_8UC3 in most cases + StructField("mode", IntegerType, true) :: Review comment: That's not true in structured streaming. Shall we don't change this here for now? Sounds like orthogonal with this current PR.. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org