[fix](postgresql) fix postgresql cann't find table (#13550)
This commit is contained in:
@ -37,6 +37,7 @@ import org.apache.logging.log4j.Logger;
|
||||
import java.io.DataInput;
|
||||
import java.io.DataOutput;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -81,7 +82,8 @@ public class OdbcTable extends Table {
|
||||
}
|
||||
|
||||
private static String psqlProperName(String name) {
|
||||
return "\"" + name + "\"";
|
||||
List<String> list = Arrays.asList(name.split("\\."));
|
||||
return list.stream().map(s -> "\"" + s + "\"").collect(Collectors.joining("."));
|
||||
}
|
||||
|
||||
public static String databaseProperName(TOdbcTableType tableType, String name) {
|
||||
|
||||
@ -101,7 +101,7 @@ public class JdbcScanNode extends ScanNode {
|
||||
continue;
|
||||
}
|
||||
Column col = slot.getColumn();
|
||||
columns.add(col.getName());
|
||||
columns.add(OdbcTable.databaseProperName(jdbcType, col.getName()));
|
||||
}
|
||||
if (0 == columns.size()) {
|
||||
columns.add("*");
|
||||
|
||||
Reference in New Issue
Block a user