Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix pyspark on spark3.0 #512

Merged
merged 2 commits into from
Dec 16, 2020
Merged

fix pyspark on spark3.0 #512

merged 2 commits into from
Dec 16, 2020

Conversation

RustRw
Copy link

@RustRw RustRw commented Nov 19, 2020

  1. fix pyspark about py4j security
  2. fix DateTimeUtils miss stringToTime methed on spark3.0

@@ -65,6 +67,21 @@ class SparkPythonExecutor(val sc: SparkContext, val sqlContext: SQLContext,sess
private[executors] var engineExecutorContext: EngineExecutorContext = _
private val lineOutputStream = new RsOutputStream

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

生成一个token

case _: TimestampType => new Timestamp(Try(timestampFormat.parse(value).getTime).getOrElse(DateTimeUtils.stringToTime(value).getTime * 1000L))
case _: DateType => new Date(Try(dateFormatP.parse(value).getTime).getOrElse(DateTimeUtils.stringToTime(value).getTime))
case _: TimestampType => new Timestamp(Try(timestampFormat.parse(value).getTime).getOrElse(stringToTime(value).getTime * 1000L))
case _: DateType => new Date(Try(dateFormatP.parse(value).getTime).getOrElse(stringToTime(value).getTime))
case _: StringType => value.replaceAll("\n|\t", " ")
case t => throw new RuntimeException(s"Unsupported cast from $value to $t")
}
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

针对 spark3.0 DataTimeUtils stringToTime方法并不存在了

Copy link
Contributor

@peacewong peacewong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@peacewong peacewong merged commit 6ff00b4 into apache:dev-0.11.0 Dec 16, 2020
This was referenced Dec 9, 2021
mayinrain pushed a commit to mayinrain/incubator-linkis that referenced this pull request Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants