[KYUUBI #1360] [MINOR] Change log level from warn to error when executing statement failed

…

<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1360 from yanghua/MINOR-LOG-LEVEL.

Closes #1360

8e846217 [yanghua] [MINOR] Change log level from warn to error when executing statement failed

Authored-by: yanghua <yanghua1127@gmail.com>
Signed-off-by: Kent Yao <yao@apache.org>
This commit is contained in:
yanghua 2021-11-11 14:41:32 +08:00 committed by Kent Yao
parent 9db2e5c054
commit 1d9b98e119
No known key found for this signature in database
GPG Key ID: F7051850A0AF904D

View File

@ -188,7 +188,7 @@ abstract class ThriftBinaryFrontendService(name: String)
Option(CURRENT_SERVER_CONTEXT.get()).foreach(_.setSessionHandle(sessionHandle))
} catch {
case e: Exception =>
warn("Error opening session: ", e)
error("Error opening session: ", e)
resp.setStatus(KyuubiSQLException.toTStatus(e, verbose = true))
}
resp
@ -204,7 +204,7 @@ abstract class ThriftBinaryFrontendService(name: String)
resp.setStatus(OK_STATUS)
} catch {
case e: Exception =>
warn("Error closing session: ", e)
error("Error closing session: ", e)
resp.setStatus(KyuubiSQLException.toTStatus(e))
} finally {
Option(CURRENT_SERVER_CONTEXT.get()).foreach(_.setSessionHandle(null))
@ -222,7 +222,7 @@ abstract class ThriftBinaryFrontendService(name: String)
resp.setStatus(OK_STATUS)
} catch {
case e: Exception =>
warn("Error getting type info: ", e)
error("Error getting type info: ", e)
resp.setInfoValue(TGetInfoValue.lenValue(0))
resp.setStatus(KyuubiSQLException.toTStatus(e))
}
@ -243,7 +243,7 @@ abstract class ThriftBinaryFrontendService(name: String)
resp.setStatus(OK_STATUS)
} catch {
case e: Exception =>
warn("Error executing statement: ", e)
error("Error executing statement: ", e)
resp.setStatus(KyuubiSQLException.toTStatus(e))
}
resp
@ -258,7 +258,7 @@ abstract class ThriftBinaryFrontendService(name: String)
resp.setStatus(OK_STATUS)
} catch {
case e: Exception =>
warn("Error getting type info: ", e)
error("Error getting type info: ", e)
resp.setStatus(KyuubiSQLException.toTStatus(e))
}
resp
@ -273,7 +273,7 @@ abstract class ThriftBinaryFrontendService(name: String)
resp.setStatus(OK_STATUS)
} catch {
case e: Exception =>
warn("Error getting catalogs: ", e)
error("Error getting catalogs: ", e)
resp.setStatus(KyuubiSQLException.toTStatus(e))
}
resp
@ -289,7 +289,7 @@ abstract class ThriftBinaryFrontendService(name: String)
resp.setStatus(OK_STATUS)
} catch {
case e: Exception =>
warn("Error getting schemas: ", e)
error("Error getting schemas: ", e)
resp.setStatus(KyuubiSQLException.toTStatus(e))
}
resp
@ -309,7 +309,7 @@ abstract class ThriftBinaryFrontendService(name: String)
resp.setStatus(OK_STATUS)
} catch {
case e: Exception =>
warn("Error getting tables: ", e)
error("Error getting tables: ", e)
resp.setStatus(KyuubiSQLException.toTStatus(e))
}
resp
@ -324,7 +324,7 @@ abstract class ThriftBinaryFrontendService(name: String)
resp.setStatus(OK_STATUS)
} catch {
case e: Exception =>
warn("Error getting table types: ", e)
error("Error getting table types: ", e)
resp.setStatus(KyuubiSQLException.toTStatus(e))
}
resp
@ -344,7 +344,7 @@ abstract class ThriftBinaryFrontendService(name: String)
resp.setStatus(OK_STATUS)
} catch {
case e: Exception =>
warn("Error getting columns: ", e)
error("Error getting columns: ", e)
resp.setStatus(KyuubiSQLException.toTStatus(e))
}
resp
@ -363,7 +363,7 @@ abstract class ThriftBinaryFrontendService(name: String)
resp.setStatus(OK_STATUS)
} catch {
case e: Exception =>
warn("Error getting functions: ", e)
error("Error getting functions: ", e)
resp.setStatus(KyuubiSQLException.toTStatus(e))
}
resp
@ -403,7 +403,7 @@ abstract class ThriftBinaryFrontendService(name: String)
resp.setStatus(OK_STATUS)
} catch {
case e: Exception =>
warn("Error getting operation status: ", e)
error("Error getting operation status: ", e)
resp.setStatus(KyuubiSQLException.toTStatus(e))
}
resp
@ -417,7 +417,7 @@ abstract class ThriftBinaryFrontendService(name: String)
resp.setStatus(OK_STATUS)
} catch {
case e: Exception =>
warn("Error cancelling operation: ", e)
error("Error cancelling operation: ", e)
resp.setStatus(KyuubiSQLException.toTStatus(e))
}
resp
@ -431,7 +431,7 @@ abstract class ThriftBinaryFrontendService(name: String)
resp.setStatus(OK_STATUS)
} catch {
case e: Exception =>
warn("Error closing operation: ", e)
error("Error closing operation: ", e)
resp.setStatus(KyuubiSQLException.toTStatus(e))
}
resp
@ -446,7 +446,7 @@ abstract class ThriftBinaryFrontendService(name: String)
resp.setStatus(OK_STATUS)
} catch {
case e: Exception =>
warn("Error getting result set metadata: ", e)
error("Error getting result set metadata: ", e)
resp.setStatus(KyuubiSQLException.toTStatus(e))
}
resp
@ -467,7 +467,7 @@ abstract class ThriftBinaryFrontendService(name: String)
resp.setStatus(OK_STATUS)
} catch {
case e: Exception =>
warn("Error fetching results: ", e)
error("Error fetching results: ", e)
resp.setStatus(KyuubiSQLException.toTStatus(e))
}
resp
@ -513,7 +513,7 @@ abstract class ThriftBinaryFrontendService(name: String)
be.closeSession(handle)
} catch {
case e: KyuubiSQLException =>
warn("Failed closing session", e)
error("Failed closing session", e)
}
}
}