You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "asdfgh19 (Jira)" <ji...@apache.org> on 2022/12/28 07:39:00 UTC
[jira] [Created] (CALCITE-5462) unknown type -1 and unknown type -4 for mysql json and blob columns
asdfgh19 created CALCITE-5462:
---------------------------------
Summary: unknown type -1 and unknown type -4 for mysql json and blob columns
Key: CALCITE-5462
URL: https://issues.apache.org/jira/browse/CALCITE-5462
Project: Calcite
Issue Type: Bug
Components: avatica
Affects Versions: avatica-1.22.0
Reporter: asdfgh19
The following code throws SQLException: Error while executing SQL "SELECT * FROM test": unknown type -1,when the table contains columns of type json or blob.
Client side:
{code:java}
public static void main(String[] args) throws ClassNotFoundException {
Class.forName("org.apache.eniot.avatica.Driver");
Properties prop = new Properties();
prop.put("serialization", "protobuf");
try(Connection conn = DriverManager.getConnection(
"jdbc:eniot:url=http://localhost:5888", prop);
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM test")) {
while (rs.next()) {
log.info("{}, {}", rs.getObject(1),
rs.getObject(2));
}
} catch (SQLException e) {
throw new RuntimeException(e);
}
} {code}
Server side:
{code:java}
public static void main(String[] args) throws SQLException {
String url = "jdbc:mysql://localhost:3306/db1";
JdbcMeta meta = new JdbcMeta(url, "root", "root");
LocalService service = new LocalService(meta);
HttpServer server = new HttpServer.Builder<>()
.withPort(5888)
.withHandler(service, Driver.Serialization.PROTOBUF)
.build();
server.start();
new Thread(() -> {
try {
server.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
}).start();
} {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)