Skip to content

doris can't get Decimals precision use java.sql.PreparedStatement com.mysql.jdbc.JDBC42 but mysql can get it  #4037

@mnloveyx

Description

@mnloveyx

PreparedStatement preparedStatement = null;
try {
preparedStatement =
connection.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_READ_ONLY );
preparedStatement.setMaxRows( 1 );
ResultSetMetaData rsmd = preparedStatement.getMetaData();
} catch ( Exception e ) {
throw new Exception( e );
} finally {
if ( preparedStatement != null ) {
try {
preparedStatement.close();
} catch ( SQLException e ) {
}
}
}
rsmd.getFields

doris Decimals precision can't get it use java.sql.PreparedStatement com.mysql.jdbc.JDBC42 see

image

mysql Decimals precision

image

doris create table
CREATE TABLE IF NOT EXISTS test1 (
id BIGINT NOT NULL COMMENT "",
need_amt DECIMAL(16,2) replace_if_not_null NULL COMMENT ""
) ENGINE=OLAP
AGGREGATE KEY(id)
COMMENT "OLAP"
DISTRIBUTED BY HASH(id) BUCKETS 6
PROPERTIES (
"replication_num" = "3",
"in_memory" = "false",
"storage_format" = "DEFAULT"
);

mysql create table

CREATE TABLE test1 (
id bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
need_amt decimal(16,2) DEFAULT NULL COMMENT '',
PRIMARY KEY (id)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='test'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stalekind/fixCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions