Skip to content

Commit

Permalink
descriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
zclllyybb committed Jan 12, 2025
1 parent 0f82df0 commit 2928660
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
12 changes: 12 additions & 0 deletions be/src/runtime/descriptors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,15 @@ std::string OlapTableDescriptor::debug_string() const {
return out.str();
}

DictionaryTableDescriptor::DictionaryTableDescriptor(const TTableDescriptor& tdesc)
: TableDescriptor(tdesc) {}

std::string DictionaryTableDescriptor::debug_string() const {
std::stringstream out;
out << "Dictionary(" << TableDescriptor::debug_string() << ")";
return out.str();
}

SchemaTableDescriptor::SchemaTableDescriptor(const TTableDescriptor& tdesc)
: TableDescriptor(tdesc), _schema_table_type(tdesc.schemaTable.tableType) {}
SchemaTableDescriptor::~SchemaTableDescriptor() = default;
Expand Down Expand Up @@ -577,6 +586,9 @@ Status DescriptorTbl::create(ObjectPool* pool, const TDescriptorTable& thrift_tb
case TTableType::TRINO_CONNECTOR_TABLE:
desc = pool->add(new TrinoConnectorTableDescriptor(tdesc));
break;
case TTableType::DICTIONARY_TABLE:
desc = pool->add(new DictionaryTableDescriptor(tdesc));
break;
default:
DCHECK(false) << "invalid table type: " << tdesc.tableType;
}
Expand Down
6 changes: 6 additions & 0 deletions be/src/runtime/descriptors.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ class OlapTableDescriptor : public TableDescriptor {
std::string debug_string() const override;
};

class DictionaryTableDescriptor : public TableDescriptor {
public:
DictionaryTableDescriptor(const TTableDescriptor& tdesc);
std::string debug_string() const override;
};

class SchemaTableDescriptor : public TableDescriptor {
public:
SchemaTableDescriptor(const TTableDescriptor& tdesc);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public LayoutType getLayout() {

@Override
public TTableDescriptor toThrift() {
TDictionaryTable tDictionaryTable = new TDictionaryTable(getName());
TDictionaryTable tDictionaryTable = new TDictionaryTable();
// TODO: use this to replace TDictionarySink.name
TTableDescriptor tTableDescriptor = new TTableDescriptor(id, TTableType.DICTIONARY_TABLE, fullSchema.size(), 0,
getName(), dbName);
Expand Down
1 change: 0 additions & 1 deletion gensrc/thrift/Descriptors.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,6 @@ struct TLakeSoulTable {
}

struct TDictionaryTable {
1: required string name
}

// "Union" of all table types.
Expand Down

0 comments on commit 2928660

Please sign in to comment.