Skip to content

Commit 4087a7b

Browse files
committed
Update README with new Docker version and enhance YAML plan error handling in PlanProcessor with logging for better debugging.
1 parent d79a0e0 commit 4087a7b

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ and deep dive into issues [from the generated report](https://data.catering/late
3838

3939
1. Docker
4040
```shell
41-
docker run -d -i -p 9898:9898 -e DEPLOY_MODE=standalone --name datacaterer datacatering/data-caterer:10
41+
docker run -d -i -p 9898:9898 -e DEPLOY_MODE=standalone --name datacaterer datacatering/data-caterer:0.16.10
4242
```
4343
[Open localhost:9898](http://localhost:9898).
4444
1. [Run Scala/Java examples](#run-scalajava-examples)

app/src/main/scala/io/github/datacatering/datacaterer/core/plan/PlanProcessor.scala

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ import io.github.datacatering.datacaterer.core.model.Constants.METADATA_CONNECTI
1212
import io.github.datacatering.datacaterer.core.model.PlanRunResults
1313
import io.github.datacatering.datacaterer.core.parser.PlanParser
1414
import io.github.datacatering.datacaterer.core.util.SparkProvider
15+
import org.apache.log4j.Logger
1516
import org.apache.spark.sql.SparkSession
1617

17-
import scala.util.{Success, Try}
18+
import scala.util.{Failure, Success, Try}
1819

1920
object PlanProcessor {
2021

@@ -147,6 +148,8 @@ object PlanProcessor {
147148
private def findYamlPlanFile(configuredPlanPath: String, planName: String)(implicit sparkSession: SparkSession): Option[String] = {
148149
import java.io.File
149150

151+
val logger = Logger.getLogger(getClass.getName)
152+
150153
// Get the parent directory from the configured plan file path
151154
val planFile = new File(configuredPlanPath)
152155
val planDir = if (planFile.isDirectory) planFile else new File(planFile.getParent)
@@ -160,7 +163,12 @@ object PlanProcessor {
160163
Try {
161164
val parsed = PlanParser.parsePlan(f.getAbsolutePath)
162165
parsed.name.equalsIgnoreCase(planName)
163-
}.getOrElse(false)
166+
} match {
167+
case Success(matches) => matches
168+
case Failure(ex) =>
169+
logger.warn(s"Failed to parse YAML plan file: ${f.getAbsolutePath}", ex)
170+
false
171+
}
164172
})
165173

166174
matchingFiles.headOption.map(_.getAbsolutePath)

0 commit comments

Comments
 (0)