Description
Currently, SearchArguments are created using column names, e.g. in orc/sargs/SearchArgument.hh
virtual SearchArgumentBuilder& lessThan(const std::string& column, PredicateDataType type, Literal literal) = 0;
The name string is the leaf field name which can be duplicated if there are nested types, e.g.
id int s1 struct<id:int,name:string> s2 struct<id:int,name:string>
There are 3 leaf columns using name 'id'. The current code of resolving the column name can only found the first matched one:
// find column id from column name uint64_t SargsApplier::findColumn(const Type& type, const std::string& colName) { for (uint64_t i = 0; i != type.getSubtypeCount(); ++i) { if (type.getFieldName(i) == colName) { return type.getSubtype(i)->getColumnId(); } else { uint64_t ret = findColumn(*type.getSubtype(i), colName); if (ret != INVALID_COLUMN_ID) { return ret; } } } return INVALID_COLUMN_ID; }
Since what we need is actually the column id, let's provide intefaces for column ids directly.
Attachments
Issue Links
- links to