You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
resp = _ds.test.select('select a as b from a', [])
panic(resp.inError, resp.error)
resp.value
If you hit localhost:5003/test, you get a SQL Exception:
SEVERE: Error in query : java.sql.SQLException: Column 'a' not found.
Root Cause
Relevant lines from JDBCWrapper:line 176 to 183
Map<String,Object> m = newLinkedHashMap<>(); // because of... order preservingfor (intindex = 1; index <= count; index++) {
Stringcolumn = rsmd.getColumnName(index);
Objectvalue = rs.getObject(column);
ObjecttransformedValue = getObject(value);
m.put(column, transformedValue);
}
result.add(m);
Root cause is rsmd.getColumnName(index); this gets the name of the column selected. But this name may differ from the actual result returned by the query.
Fix
Replace rsmd.getColumnName(index); with rsmd.getColumnLabel(index);. As per documentation,
Gets the designated column's suggested title for use in printouts and displays. The suggested title is usually specified by the SQL AS clause. If a SQL AS is not specified, the value returned from getColumnLabel will be the same as the value returned by the getColumnName method.
The text was updated successfully, but these errors were encountered:
Consider the following yaml file:
test.zm
If you hit
localhost:5003/test
, you get a SQL Exception:Root Cause
Relevant lines from JDBCWrapper:line 176 to 183
Root cause is
rsmd.getColumnName(index);
this gets the name of the column selected. But this name may differ from the actual result returned by the query.Fix
Replace
rsmd.getColumnName(index);
withrsmd.getColumnLabel(index);
. As per documentation,The text was updated successfully, but these errors were encountered: