Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static void main(String[] args) throws Exception {
final IoTDBStatement statement = (IoTDBStatement) connection.createStatement()) {

final String insertSQLWithGB18030 =
"insert into root.测试(timestamp, 维语, 彝语, 繁体, 蒙文, 简体, 标点符号, 藏语) values(1, 'ئۇيغۇر تىلى', 'ꆈꌠꉙ', \"繁體\", 'ᠮᠣᠩᠭᠣᠯ ᠬᠡᠯᠡ', '简体', '——?!', \"བོད་སྐད།\");";
"insert into root.测试(timestamp, 彝语, 繁体, 蒙文, 简体, 标点符号, 藏语) values(1, 'ꆈꌠꉙ', \"繁體\", 'ᠮᠣᠩᠭᠣᠯ ᠬᠡᠯᠡ', '简体', '——?!', \"བོད་སྐད།\");";
final byte[] insertSQLWithGB18030Bytes = insertSQLWithGB18030.getBytes("GB18030");
statement.execute(insertSQLWithGB18030Bytes);
} catch (IoTDBSQLException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,11 @@ public byte getByte(String columnName) throws SQLException {
@Override
public byte[] getBytes(int columnIndex) throws SQLException {
try {
return ioTDBRpcDataSet.getDataType(columnIndex).equals(TSDataType.BLOB)
final TSDataType dataType = ioTDBRpcDataSet.getDataType(columnIndex);
if (dataType == null) {
return null;
}
return dataType.equals(TSDataType.BLOB)
? ioTDBRpcDataSet.getBinary(columnIndex).getValues()
: ioTDBRpcDataSet.getString(columnIndex).getBytes(charset);
} catch (StatementExecutionException e) {
Expand All @@ -388,7 +392,11 @@ public byte[] getBytes(int columnIndex) throws SQLException {
@Override
public byte[] getBytes(String columnName) throws SQLException {
try {
return ioTDBRpcDataSet.getDataType(columnName).equals(TSDataType.BLOB)
final TSDataType dataType = ioTDBRpcDataSet.getDataType(columnName);
if (dataType == null) {
return null;
}
return dataType.equals(TSDataType.BLOB)
? ioTDBRpcDataSet.getBinary(columnName).getValues()
: ioTDBRpcDataSet.getString(columnName).getBytes(charset);
} catch (StatementExecutionException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,13 @@ public TSDataType getDataType(int columnIndex) throws StatementExecutionExceptio
}

public TSDataType getDataType(String columnName) throws StatementExecutionException {
return columnTypeDeduplicatedList.get(columnOrdinalMap.get(columnName) - START_INDEX);
if (columnName.equals(TIMESTAMP_STR)) {
return TSDataType.INT64;
}
final int index = columnOrdinalMap.get(columnName) - START_INDEX;
return index < 0 || index >= columnTypeDeduplicatedList.size()
? null
: columnTypeDeduplicatedList.get(index);
}

public int findColumn(String columnName) {
Expand Down