Skip to content

Commit

Permalink
fix some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
browniecode93 committed Oct 6, 2023
1 parent 34cd5ad commit bae2ddf
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ case class Environment(name: String,
autoSchema: Boolean = false,
namespaces: Seq[String] = Seq.empty,
infix_namespaces: Seq[String] = Seq.empty,
enableJDBC: Boolean,
queryOutputLocation: Option[String])
enableJDBC: Boolean = false,
queryOutputLocation: String = "")
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ class TableReader(fqn : String, enableJDBC: Boolean, queryOutputLocation: String
}

object TableReader {
def apply(fqn: String) = new TableReader(fqn)
def apply(fqn: String, enableJDBC: Boolean, queryOutputLocation: String) = new TableReader(fqn, enableJDBC, queryOutputLocation)

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ object MetabolicReader extends Logging {

def read(source: Source, historical: Boolean, mode: EngineMode, enableJDBC: Boolean, queryOutputLocation: String)(implicit spark: SparkSession) = {

val input = readSource(source, mode, spark, enableJDBC)
val input = readSource(source, mode, spark, enableJDBC, queryOutputLocation)

val prepared = prepareSource(source, historical, input)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ class ConfigParserService(implicit region: Regions) extends Logging {
}

val queryOutputLocation = if (config.hasPathOrNull("queryOutputLocation")) {
Option.apply(config.getString("queryOutputLocation"))
config.getString("queryOutputLocation")
} else {
Option.empty
""
}

Environment(envPrefix, engineMode, baseCheckpointLocation, crawl, dbname, iamrole, atlanToken, atlanBaseUrl,historical, autoSchema, namespaces, infix_namespaces, enableJDBC, queryOutputLocation)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class MetabolicReaderIT extends AnyFunSuite

val source = getFileSource(inputPath, tableName, IOFormat.PARQUET.toString).head

MetabolicReader.read(source, true, EngineMode.Batch)(spark)
MetabolicReader.read(source, true, EngineMode.Batch, false, "")(spark)

val result = spark.table(tableName)

Expand All @@ -103,7 +103,7 @@ class MetabolicReaderIT extends AnyFunSuite

val source = getFileSource(inputPath, tableName, IOFormat.JSON.toString).head

MetabolicReader.read(source, true, EngineMode.Batch)(spark)
MetabolicReader.read(source, true, EngineMode.Batch, false, "")(spark)

val result = spark.table(tableName)

Expand All @@ -129,7 +129,7 @@ class MetabolicReaderIT extends AnyFunSuite

val source = getFileSource(inputPath, tableName, IOFormat.CSV.toString).head

MetabolicReader.read(source, true, EngineMode.Batch)(spark)
MetabolicReader.read(source, true, EngineMode.Batch, false, "")(spark)

val result = spark.table(tableName)

Expand All @@ -153,7 +153,7 @@ class MetabolicReaderIT extends AnyFunSuite

val source = getFileSource(inputPath, tableName, IOFormat.DELTA.toString).head

MetabolicReader.read(source, true, EngineMode.Batch)(spark)
MetabolicReader.read(source, true, EngineMode.Batch, false, "")(spark)

val result = spark.table(tableName)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ProdConfigsMetabolicAppIT extends AnyFunSuite
.parseConfig(config)

parsedConfig.head.sources.foreach { source =>
MetabolicReader.read(source, true, EngineMode.Batch)(spark)
MetabolicReader.read(source, true, EngineMode.Batch, false, "")(spark)
}


Expand Down

0 comments on commit bae2ddf

Please sign in to comment.