ngaur9 commented on code in PR #608:
URL: https://github.com/apache/incubator-sedona/pull/608#discussion_r853574134


##########
sql/src/main/scala/org/apache/spark/sql/sedona_sql/expressions/Constructors.scala:
##########
@@ -94,6 +94,36 @@ case class ST_PolygonFromText(inputExpressions: 
Seq[Expression])
   }
 }
 
+/**
+  * Return a line from a string. The string must be plain string and each 
coordinate must be separated by a delimiter.
+  *
+  * @param inputExpressions
+  */
+case class ST_LineFromText(inputExpressions: Seq[Expression])
+  extends Expression with CodegenFallback with UserDataGeneratator {
+  // This is an expression which takes one input expressions.
+  assert(inputExpressions.length == 1)
+
+  override def nullable: Boolean = false
+
+  override def eval(inputRow: InternalRow): Any = {
+    val lineString = 
inputExpressions(0).eval(inputRow).asInstanceOf[UTF8String].toString
+
+    var fileDataSplitter = FileDataSplitter.WKT
+    var formatMapper = new FormatMapper(fileDataSplitter, false, 
GeometryType.LINESTRING)

Review Comment:
   Added the Linestring filter to it. Please, let me know if anything else 
needs to be done. 



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to