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

adding delta lake 0.6.0 support #302

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
support delta lake input
mahmeahmed committed Jun 29, 2020
commit 76565846e13a49cc68f6a2844683bf9131fe031f
Original file line number Diff line number Diff line change
@@ -39,6 +39,8 @@ import com.hortonworks.spark.atlas.sql.SparkExecutionPlanProcessor.SinkDataSourc
import com.hortonworks.spark.atlas.types.{AtlasEntityUtils, external, internal}
import com.hortonworks.spark.atlas.utils.SparkUtils.sparkSession
import com.hortonworks.spark.atlas.utils.{Logging, SparkUtils}
import org.apache.hadoop.fs.Path
import org.apache.spark.sql.delta.DeltaLog
import org.apache.spark.sql.delta.sources.DeltaDataSource
import org.apache.spark.sql.execution.datasources.jdbc.JDBCOptions
import org.apache.spark.sql.streaming.SinkProgress
@@ -245,6 +247,12 @@ object CommandsHarvester extends AtlasEntityUtils with Logging {
tChildren.flatMap {
case r: HiveTableRelation => Seq(tableToEntity(r.tableMeta))
case v: View => Seq(tableToEntity(v.desc))
case LogicalRelation(fileRelation: FileRelation, _, catalogTable, _)
if fileRelation.getClass.getName.contains("org.apache.spark.sql.delta.DeltaLog") =>
if (fileRelation.inputFiles.nonEmpty) {
val path = new Path(fileRelation.inputFiles.head).getParent.toString
Seq(external.pathToEntity(path))
} else Seq.empty
case LogicalRelation(fileRelation: FileRelation, _, catalogTable, _) =>
catalogTable.map(tbl => Seq(tableToEntity(tbl))).getOrElse(
fileRelation.inputFiles.flatMap(file => Seq(external.pathToEntity(file))).toSeq)