diff --git a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseCatalog.scala b/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseCatalog.scala index dc9d1a84..76d6ed50 100644 --- a/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseCatalog.scala +++ b/spark-3.5/clickhouse-spark/src/main/scala/xenon/clickhouse/ClickHouseCatalog.scala @@ -118,25 +118,17 @@ class ClickHouseCatalog extends TableCatalog val (database, table) = unwrap(ident) match { case None => throw new NoSuchTableException(ident) case Some((db, tbl)) => -// println(s"loadTable: $db, $tbl") nodeClient.syncQueryOutputJSONEachRow(s"SELECT * FROM `$db`.`$tbl` WHERE 1=0") match { - case Left(exception) - if exception.code == UNKNOWN_TABLE.code => - throw new NoSuchTableException(ident) + case Left(exception) if exception.code == UNKNOWN_TABLE.code => throw new NoSuchTableException(ident) // not sure if this check is necessary case Left(exception) if exception.code == UNKNOWN_DATABASE.code => throw new NoSuchTableException(s"Database $db does not exist") - case Left (exception) if (exception.toString.indexOf("Code: 60. DB::Exception: Unknown table") > 0) => + case Left (exception) if exception.toString.indexOf("Code: 60. DB::Exception: Unknown table") > 0 => throw new NoSuchTableException(ident) - case Left(rethrow) => { - val x : Int = rethrow.code -// println(s"loadTable error: $db, $tbl, $x, ($rethrow.code), [$rethrow]") + case Left(rethrow) => throw rethrow - } - case Right(_) => { -// println(s"loadTable: $db, $tbl, Right") + case Right(_) => (db, tbl) - } } } implicit val _tz: ZoneId = tz.merge