Skip to content

Commit

Permalink
spotless fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mzitnik committed Jul 10, 2024
1 parent 2cd19f3 commit a89e0d6
Showing 1 changed file with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a89e0d6

Please sign in to comment.