Skip to content

Commit

Permalink
Rename VAR_LIST to LIST
Browse files Browse the repository at this point in the history
  • Loading branch information
manh9203 committed Apr 1, 2024
1 parent 6b1d45a commit 3a52fb0
Show file tree
Hide file tree
Showing 108 changed files with 803 additions and 815 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion extension/duckdb_scanner/src/duckdb_scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void getDuckDBVectorConversionFunc(
case PhysicalTypeID::INTERVAL: {
conversion_func = convertDuckDBVectorToVector<interval_t>;
} break;
case PhysicalTypeID::VAR_LIST: {
case PhysicalTypeID::LIST: {
conversion_func = convertDuckDBVectorToVector<list_entry_t>;
} break;
case PhysicalTypeID::STRUCT: {
Expand Down
2 changes: 1 addition & 1 deletion extension/duckdb_scanner/src/duckdb_type_converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ common::LogicalType DuckDBTypeConverter::convertDuckDBType(std::string typeStr)
return LogicalType{LogicalTypeID::STRING};
} else if (typeStr.ends_with("[]")) {
auto innerType = convertDuckDBType(typeStr.substr(0, typeStr.size() - 2));
return *LogicalType::VAR_LIST(innerType.copy());
return *LogicalType::LIST(innerType.copy());
} else if (typeStr.starts_with("STRUCT")) {
return *LogicalType::STRUCT(parseStructTypeInfo(typeStr));
} else if (typeStr.starts_with("UNION")) {
Expand Down
4 changes: 2 additions & 2 deletions src/binder/bind/bind_graph_pattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ QueryGraph Binder::bindPatternElement(const PatternElement& patternElement) {

static std::unique_ptr<LogicalType> getRecursiveRelLogicalType(
const LogicalType& nodeType, const LogicalType& relType) {
auto nodesType = LogicalType::VAR_LIST(nodeType.copy());
auto relsType = LogicalType::VAR_LIST(relType.copy());
auto nodesType = LogicalType::LIST(nodeType.copy());
auto relsType = LogicalType::LIST(relType.copy());
std::vector<StructField> recursiveRelFields;
recursiveRelFields.emplace_back(InternalKeyword::NODES, std::move(nodesType));
recursiveRelFields.emplace_back(InternalKeyword::RELS, std::move(relsType));
Expand Down
4 changes: 2 additions & 2 deletions src/binder/bind/bind_reading_clause.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ void Binder::rewriteMatchPattern(BoundGraphPattern& boundGraphPattern) {
std::unique_ptr<BoundReadingClause> Binder::bindUnwindClause(const ReadingClause& readingClause) {
auto& unwindClause = ku_dynamic_cast<const ReadingClause&, const UnwindClause&>(readingClause);
auto boundExpression = expressionBinder.bindExpression(*unwindClause.getExpression());
ExpressionBinder::validateDataType(*boundExpression, LogicalTypeID::VAR_LIST);
ExpressionBinder::validateDataType(*boundExpression, LogicalTypeID::LIST);
auto aliasName = unwindClause.getAlias();
auto alias = createVariable(aliasName, *VarListType::getChildType(&boundExpression->dataType));
auto alias = createVariable(aliasName, *ListType::getChildType(&boundExpression->dataType));
std::shared_ptr<Expression> idExpr = nullptr;
if (scope.hasMemorizedTableIDs(boundExpression->getAlias())) {
auto tableIDs = scope.getMemorizedTableIDs(boundExpression->getAlias());
Expand Down
2 changes: 1 addition & 1 deletion src/binder/bind_expression/bind_function_expression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ static std::vector<std::unique_ptr<Value>> populateLabelValues(std::vector<table

std::shared_ptr<Expression> ExpressionBinder::bindLabelFunction(const Expression& expression) {
auto catalog = context->getCatalog();
auto listType = LogicalType::VAR_LIST(LogicalType::STRING());
auto listType = LogicalType::LIST(LogicalType::STRING());
expression_vector children;
switch (expression.getDataType().getLogicalTypeID()) {
case LogicalTypeID::NODE: {
Expand Down
2 changes: 1 addition & 1 deletion src/c_api/data_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ kuzu_logical_type* kuzu_data_type_create(
auto extraTypeInfo =
num_elements_in_array > 0 ?
std::make_unique<ArrayTypeInfo>(std::move(child_type_pty), num_elements_in_array) :
std::make_unique<VarListTypeInfo>(std::move(child_type_pty));
std::make_unique<ListTypeInfo>(std::move(child_type_pty));
data_type = CAPIHelper::createLogicalType(logicalTypeID, std::move(extraTypeInfo));
}
c_data_type->_data_type = data_type;
Expand Down
18 changes: 9 additions & 9 deletions src/common/arrow/arrow_array_scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ static void scanArrowArrayFixedBLOB(const ArrowArray* array, ValueVector& output
}

template<typename offsetsT>
static void scanArrowArrayVarList(const ArrowSchema* schema, const ArrowArray* array,
static void scanArrowArrayList(const ArrowSchema* schema, const ArrowArray* array,
ValueVector& outputVector, ArrowNullMaskTree* mask, uint64_t srcOffset, uint64_t dstOffset,
uint64_t count) {
auto offsets = ((const offsetsT*)array->buffers[1]) + srcOffset;
Expand All @@ -177,7 +177,7 @@ static void scanArrowArrayVarList(const ArrowSchema* schema, const ArrowArray* a
}

template<typename offsetsT>
static void scanArrowArrayVarListView(const ArrowSchema* schema, const ArrowArray* array,
static void scanArrowArrayListView(const ArrowSchema* schema, const ArrowArray* array,
ValueVector& outputVector, ArrowNullMaskTree* mask, uint64_t srcOffset, uint64_t dstOffset,
uint64_t count) {
auto offsets = ((const offsetsT*)array->buffers[1]) + srcOffset;
Expand Down Expand Up @@ -491,12 +491,12 @@ void ArrowConverter::fromArrowArray(const ArrowSchema* schema, const ArrowArray*
return scanArrowArrayRunEndEncoded(
schema, array, outputVector, mask, srcOffset, dstOffset, count);
case 'l':
// VAR_LIST
return scanArrowArrayVarList<int32_t>(
// LIST
return scanArrowArrayList<int32_t>(
schema, array, outputVector, mask, srcOffset, dstOffset, count);
case 'L':
// LONG VAR_LIST
return scanArrowArrayVarList<int64_t>(
// LONG LIST
return scanArrowArrayList<int64_t>(
schema, array, outputVector, mask, srcOffset, dstOffset, count);
case 'w':
// FIXED_LIST
Expand Down Expand Up @@ -525,12 +525,12 @@ void ArrowConverter::fromArrowArray(const ArrowSchema* schema, const ArrowArray*
case 'v':
switch (arrowType[2]) {
case 'l':
return scanArrowArrayVarListView<int32_t>(
return scanArrowArrayListView<int32_t>(
schema, array, outputVector, mask, srcOffset, dstOffset, count);
case 'L':
return scanArrowArrayVarListView<int64_t>(
return scanArrowArrayListView<int64_t>(
schema, array, outputVector, mask, srcOffset, dstOffset, count);
// LONG VAR_LIST VIEW
// LONG LIST VIEW
default:
KU_UNREACHABLE;
}
Expand Down
2 changes: 1 addition & 1 deletion src/common/arrow/arrow_converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void ArrowConverter::setArrowFormat(
case LogicalTypeID::STRING: {
child.format = "u";
} break;
case LogicalTypeID::VAR_LIST: {
case LogicalTypeID::LIST: {
child.format = "+l";
child.n_children = 1;
rootHolder.nestedChildren.emplace_back();
Expand Down
32 changes: 16 additions & 16 deletions src/common/arrow/arrow_row_batch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void ArrowRowBatch::templateInitializeVector<LogicalTypeID::STRING>(
}

template<>
void ArrowRowBatch::templateInitializeVector<LogicalTypeID::VAR_LIST>(
void ArrowRowBatch::templateInitializeVector<LogicalTypeID::LIST>(
ArrowVector* vector, const main::DataTypeInfo& typeInfo, std::int64_t capacity) {
initializeNullBits(vector->validity, capacity);
KU_ASSERT(typeInfo.childrenTypesInfo.size() == 1);
Expand Down Expand Up @@ -168,8 +168,8 @@ std::unique_ptr<ArrowVector> ArrowRowBatch::createVector(
case LogicalTypeID::STRING: {
templateInitializeVector<LogicalTypeID::STRING>(result.get(), typeInfo, capacity);
} break;
case LogicalTypeID::VAR_LIST: {
templateInitializeVector<LogicalTypeID::VAR_LIST>(result.get(), typeInfo, capacity);
case LogicalTypeID::LIST: {
templateInitializeVector<LogicalTypeID::LIST>(result.get(), typeInfo, capacity);
} break;
case LogicalTypeID::ARRAY: {
templateInitializeVector<LogicalTypeID::ARRAY>(result.get(), typeInfo, capacity);
Expand Down Expand Up @@ -263,7 +263,7 @@ void ArrowRowBatch::templateCopyNonNullValue<LogicalTypeID::UUID>(
}

template<>
void ArrowRowBatch::templateCopyNonNullValue<LogicalTypeID::VAR_LIST>(
void ArrowRowBatch::templateCopyNonNullValue<LogicalTypeID::LIST>(
ArrowVector* vector, const main::DataTypeInfo& typeInfo, Value* value, std::int64_t pos) {
vector->data.resize((pos + 2) * sizeof(std::uint32_t));
auto offsets = (std::uint32_t*)vector->data.data();
Expand All @@ -277,11 +277,11 @@ void ArrowRowBatch::templateCopyNonNullValue<LogicalTypeID::VAR_LIST>(
for (auto i = currentNumBytesForChildValidity; i < numBytesForChildValidity; i++) {
vector->childData[0]->validity.data()[i] = 0xFF; // Init each value to be valid (as 1).
}
// If vector->childData[0] is a VAR_LIST, its data buffer will be resized when we add a new
// If vector->childData[0] is a LIST, its data buffer will be resized when we add a new
// value into it
// If vector->childData[0] is an ARRAY, its data buffer is supposed to be empty,
// so we don't resize it here
if (typeInfo.childrenTypesInfo[0]->typeID != LogicalTypeID::VAR_LIST &&
if (typeInfo.childrenTypesInfo[0]->typeID != LogicalTypeID::LIST &&
typeInfo.childrenTypesInfo[0]->typeID != LogicalTypeID::ARRAY) {
vector->childData[0]->data.resize(
numChildElements * storage::StorageUtils::getDataTypeSize(
Expand All @@ -305,11 +305,11 @@ void ArrowRowBatch::templateCopyNonNullValue<LogicalTypeID::ARRAY>(
for (auto i = currentNumBytesForChildValidity; i < numBytesForChildValidity; i++) {
vector->childData[0]->validity.data()[i] = 0xFF; // Init each value to be valid (as 1).
}
// If vector->childData[0] is a VAR_LIST, its data buffer will be resized when we add a new
// If vector->childData[0] is a LIST, its data buffer will be resized when we add a new
// value into it
// If vector->childData[0] is an ARRAY, its data buffer is supposed to be empty,
// so we don't resize it here
if (typeInfo.childrenTypesInfo[0]->typeID != LogicalTypeID::VAR_LIST &&
if (typeInfo.childrenTypesInfo[0]->typeID != LogicalTypeID::LIST &&
typeInfo.childrenTypesInfo[0]->typeID != LogicalTypeID::ARRAY) {
vector->childData[0]->data.resize(
numChildElements * storage::StorageUtils::getDataTypeSize(
Expand Down Expand Up @@ -442,8 +442,8 @@ void ArrowRowBatch::copyNonNullValue(
case LogicalTypeID::STRING: {
templateCopyNonNullValue<LogicalTypeID::STRING>(vector, typeInfo, value, pos);
} break;
case LogicalTypeID::VAR_LIST: {
templateCopyNonNullValue<LogicalTypeID::VAR_LIST>(vector, typeInfo, value, pos);
case LogicalTypeID::LIST: {
templateCopyNonNullValue<LogicalTypeID::LIST>(vector, typeInfo, value, pos);
} break;
case LogicalTypeID::ARRAY: {
templateCopyNonNullValue<LogicalTypeID::ARRAY>(vector, typeInfo, value, pos);
Expand Down Expand Up @@ -483,7 +483,7 @@ void ArrowRowBatch::templateCopyNullValue<LogicalTypeID::STRING>(
}

template<>
void ArrowRowBatch::templateCopyNullValue<LogicalTypeID::VAR_LIST>(
void ArrowRowBatch::templateCopyNullValue<LogicalTypeID::LIST>(
ArrowVector* vector, std::int64_t pos) {
auto offsets = (std::uint32_t*)vector->data.data();
offsets[pos + 1] = offsets[pos];
Expand Down Expand Up @@ -568,8 +568,8 @@ void ArrowRowBatch::copyNullValue(ArrowVector* vector, Value* value, std::int64_
case LogicalTypeID::STRING: {
templateCopyNullValue<LogicalTypeID::STRING>(vector, pos);
} break;
case LogicalTypeID::VAR_LIST: {
templateCopyNullValue<LogicalTypeID::VAR_LIST>(vector, pos);
case LogicalTypeID::LIST: {
templateCopyNullValue<LogicalTypeID::LIST>(vector, pos);
} break;
case LogicalTypeID::ARRAY: {
templateCopyNullValue<LogicalTypeID::ARRAY>(vector, pos);
Expand Down Expand Up @@ -639,7 +639,7 @@ ArrowArray* ArrowRowBatch::templateCreateArray<LogicalTypeID::STRING>(
}

template<>
ArrowArray* ArrowRowBatch::templateCreateArray<LogicalTypeID::VAR_LIST>(
ArrowArray* ArrowRowBatch::templateCreateArray<LogicalTypeID::LIST>(
ArrowVector& vector, const main::DataTypeInfo& typeInfo) {
auto result = createArrayFromVector(vector);
vector.childPointers.resize(1);
Expand Down Expand Up @@ -768,8 +768,8 @@ ArrowArray* ArrowRowBatch::convertVectorToArray(
case LogicalTypeID::STRING: {
return templateCreateArray<LogicalTypeID::STRING>(vector, typeInfo);
}
case LogicalTypeID::VAR_LIST: {
return templateCreateArray<LogicalTypeID::VAR_LIST>(vector, typeInfo);
case LogicalTypeID::LIST: {
return templateCreateArray<LogicalTypeID::LIST>(vector, typeInfo);
}
case LogicalTypeID::ARRAY: {
return templateCreateArray<LogicalTypeID::ARRAY>(vector, typeInfo);
Expand Down
4 changes: 2 additions & 2 deletions src/common/arrow/arrow_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ LogicalType ArrowConverter::fromArrowSchema(const ArrowSchema* schema) {
// complex types need a complementary ExtraTypeInfo object
case 'l':
case 'L':
return *LogicalType::VAR_LIST(
return *LogicalType::LIST(
std::make_unique<LogicalType>(fromArrowSchema(schema->children[0])));
case 'w':
throw RuntimeException("Fixed list is currently WIP.");
Expand Down Expand Up @@ -129,7 +129,7 @@ LogicalType ArrowConverter::fromArrowSchema(const ArrowSchema* schema) {
switch (arrowType[2]) {
case 'l':
case 'L':
return *LogicalType::VAR_LIST(
return *LogicalType::LIST(
std::make_unique<LogicalType>(fromArrowSchema(schema->children[0])));
default:
KU_UNREACHABLE;
Expand Down
2 changes: 1 addition & 1 deletion src/common/type_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static std::string entryToString(
case LogicalTypeID::INTERNAL_ID:
return TypeUtils::toString(*reinterpret_cast<const internalID_t*>(value));
case LogicalTypeID::ARRAY:
case LogicalTypeID::VAR_LIST:
case LogicalTypeID::LIST:
return TypeUtils::toString(*reinterpret_cast<const list_entry_t*>(value), valueVector);
case LogicalTypeID::MAP:
return TypeUtils::toString(*reinterpret_cast<const map_entry_t*>(value), valueVector);
Expand Down
2 changes: 1 addition & 1 deletion src/common/types/ku_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace common {

void ku_list_t::set(const uint8_t* values, const LogicalType& dataType) const {
memcpy(reinterpret_cast<uint8_t*>(overflowPtr), values,
size * storage::StorageUtils::getDataTypeSize(*VarListType::getChildType(&dataType)));
size * storage::StorageUtils::getDataTypeSize(*ListType::getChildType(&dataType)));
}

void ku_list_t::set(const std::vector<uint8_t*>& parameters, LogicalTypeID childTypeId) {
Expand Down
Loading

0 comments on commit 3a52fb0

Please sign in to comment.