@@ -646,7 +646,7 @@ private int asColNum(String column) {
646646 }
647647 }
648648 // TODO Java8
649- throw new RuntimeException ("no column " + column + " in columns list " + getColumnNames ());
649+ throw new RuntimeException ("no column " + column + " in columns list " + getColumnNamesString ());
650650 }
651651
652652 private ByteFragment getValue (int colNum ) {
@@ -700,6 +700,14 @@ public BigDecimal getBigDecimal(int columnIndex, int scale) {
700700 return result .setScale (scale , RoundingMode .HALF_UP );
701701 }
702702
703+ public String [] getColumnNames () {
704+ String [] columnNames = new String [columns .size ()];
705+ for (int i = 0 ; i < columns .size (); ++i ) {
706+ columnNames [i ] = columns .get (i ).getColumnName ();
707+ }
708+ return columnNames ;
709+ }
710+
703711 @ Override
704712 public void setFetchDirection (int direction ) throws SQLException {
705713 // ignore perfomance hint
@@ -719,7 +727,7 @@ public String toString() {
719727 ", bis=" + bis +
720728 ", db='" + db + '\'' +
721729 ", table='" + table + '\'' +
722- ", columns=" + getColumnNames () +
730+ ", columns=" + getColumnNamesString () +
723731 ", maxRows=" + maxRows +
724732 ", values=" + Arrays .toString (values ) +
725733 ", lastReadColumn=" + lastReadColumn +
@@ -729,7 +737,7 @@ public String toString() {
729737 '}' ;
730738 }
731739
732- private String getColumnNames () {
740+ private String getColumnNamesString () {
733741 StringBuilder sb = new StringBuilder ();
734742 for (ClickHouseColumnInfo info : columns ) {
735743 sb .append (info .getColumnName ()).append (' ' );
0 commit comments