@@ -304,11 +304,10 @@ object JoinUtils {
304
304
s " KeyName: $keyName, leftSide KeyName: $leftSideKeyName , Join right to left: ${joinPart.rightToLeft
305
305
.mkString(" , " )}" )
306
306
val values = collectedLeft.map(row => row.getAs[Any ](leftSideKeyName))
307
- // Check for null keys, warn if found, err if all null
307
+ // Check for null keys, warn if found
308
308
val (notNullValues, nullValues) = values.partition(_ != null )
309
309
if (notNullValues.isEmpty) {
310
- throw new RuntimeException (
311
- s " No not-null keys found for key: $keyName. Check source table or where clauses. " )
310
+ logger.warn(s " No not-null keys found for key: $keyName. " )
312
311
} else if (! nullValues.isEmpty) {
313
312
logger.warn(s " Found ${nullValues.length} null keys for key: $keyName. " )
314
313
}
@@ -319,8 +318,11 @@ object JoinUtils {
319
318
case other => other.toString // Keep other types (like Int) as they are
320
319
}.toSet
321
320
322
- // Form the final WHERE clause for injection
323
- s " $groupByKeyExpression in ( ${valueSet.mkString(sep = " ," )}) "
321
+ if (valueSet.isEmpty) {
322
+ " false"
323
+ } else {
324
+ s " $groupByKeyExpression in ( ${valueSet.mkString(sep = " ," )}) "
325
+ }
324
326
}
325
327
.foreach { whereClause =>
326
328
// Skip adding the filter if it is a join source
0 commit comments