diff --git a/src/substrait/textplan/PlanPrinterVisitor.cpp b/src/substrait/textplan/PlanPrinterVisitor.cpp index 91585517..634ac4bd 100644 --- a/src/substrait/textplan/PlanPrinterVisitor.cpp +++ b/src/substrait/textplan/PlanPrinterVisitor.cpp @@ -476,6 +476,8 @@ std::any PlanPrinterVisitor::visitType(const ::substrait::proto::Type& type) { case ::substrait::proto::Type::kMap: case ::substrait::proto::Type::kUserDefined: case ::substrait::proto::Type::kUserDefinedTypeReference: + case ::substrait::proto::Type::kPrecisionTimestamp: + case ::substrait::proto::Type::kPrecisionTimestampTz: errorListener_->addError( "Unsupported type requested: " + type.ShortDebugString()); return std::string("UNSUPPORTED_TYPE"); @@ -572,6 +574,8 @@ std::any PlanPrinterVisitor::visitLiteral( case ::substrait::proto::Expression_Literal::kEmptyList: case ::substrait::proto::Expression_Literal::kEmptyMap: case ::substrait::proto::Expression_Literal::kUserDefined: + case ::substrait::proto::Expression_Literal::kPrecisionTimestamp: + case ::substrait::proto::Expression_Literal::kPrecisionTimestampTz: errorListener_->addError( "Literal of this type not yet supported: " + literal.ShortDebugString()); diff --git a/src/substrait/textplan/converter/BasePlanProtoVisitor.cpp b/src/substrait/textplan/converter/BasePlanProtoVisitor.cpp index bcbacfc3..24837f2c 100644 --- a/src/substrait/textplan/converter/BasePlanProtoVisitor.cpp +++ b/src/substrait/textplan/converter/BasePlanProtoVisitor.cpp @@ -175,6 +175,8 @@ std::any BasePlanProtoVisitor::visitType(const ::substrait::proto::Type& type) { case ::substrait::proto::Type::kUserDefined: return visitTypeUserDefined(type.user_defined()); case ::substrait::proto::Type::kUserDefinedTypeReference: + case ::substrait::proto::Type::kPrecisionTimestamp: + case ::substrait::proto::Type::kPrecisionTimestampTz: SUBSTRAIT_UNSUPPORTED( "user_defined_type_reference was replaced by user_defined_type. " "Please update your plan version."); @@ -366,6 +368,9 @@ std::any BasePlanProtoVisitor::visitLiteral( return visitTypeMap(literal.empty_map()); case ::substrait::proto::Expression_Literal::kUserDefined: return visitUserDefined(literal.user_defined()); + case ::substrait::proto::Expression_Literal::kPrecisionTimestamp: + case ::substrait::proto::Expression_Literal::kPrecisionTimestampTz: + return std::nullopt; case ::substrait::proto::Expression_Literal::LITERAL_TYPE_NOT_SET: break; } diff --git a/src/substrait/textplan/parser/SubstraitPlanRelationVisitor.cpp b/src/substrait/textplan/parser/SubstraitPlanRelationVisitor.cpp index 51525404..01c6e8c9 100644 --- a/src/substrait/textplan/parser/SubstraitPlanRelationVisitor.cpp +++ b/src/substrait/textplan/parser/SubstraitPlanRelationVisitor.cpp @@ -24,6 +24,13 @@ #include "substrait/textplan/StructuredSymbolData.h" #include "substrait/textplan/SymbolTable.h" +// The visitor should try and be tolerant of older plans. This +// requires calling deprecated APIs. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#pragma gcc diagnostic push +#pragma gcc diagnostic ignored "-Wdeprecated-declarations" + namespace io::substrait::textplan { namespace { @@ -147,6 +154,14 @@ void setNullable(::substrait::proto::Type* type) { type->mutable_user_defined()->set_nullability( ::substrait::proto::Type_Nullability_NULLABILITY_NULLABLE); break; + case ::substrait::proto::Type::kPrecisionTimestamp: + type->mutable_precision_timestamp()->set_nullability( + ::substrait::proto::Type_Nullability_NULLABILITY_NULLABLE); + break; + case ::substrait::proto::Type::kPrecisionTimestampTz: + type->mutable_precision_timestamp_tz()->set_nullability( + ::substrait::proto::Type_Nullability_NULLABILITY_NULLABLE); + break; case ::substrait::proto::Type::kUserDefinedTypeReference: case ::substrait::proto::Type::KIND_NOT_SET: // We are guaranteed to have a valid type so no need to emit an error. @@ -2166,3 +2181,6 @@ bool SubstraitPlanRelationVisitor::hasSubquery( } } // namespace io::substrait::textplan + +#pragma clang diagnostic pop +#pragma gcc diagnostic pop diff --git a/src/substrait/textplan/parser/SubstraitPlanSubqueryRelationVisitor.cpp b/src/substrait/textplan/parser/SubstraitPlanSubqueryRelationVisitor.cpp index 29e91976..ffa1be3e 100644 --- a/src/substrait/textplan/parser/SubstraitPlanSubqueryRelationVisitor.cpp +++ b/src/substrait/textplan/parser/SubstraitPlanSubqueryRelationVisitor.cpp @@ -24,6 +24,13 @@ #include "substrait/textplan/StructuredSymbolData.h" #include "substrait/textplan/SymbolTable.h" +// The visitor should try and be tolerant of older plans. This +// requires calling deprecated APIs. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#pragma gcc diagnostic push +#pragma gcc diagnostic ignored "-Wdeprecated-declarations" + namespace io::substrait::textplan { namespace { @@ -147,6 +154,14 @@ void setNullable(::substrait::proto::Type* type) { type->mutable_user_defined()->set_nullability( ::substrait::proto::Type_Nullability_NULLABILITY_NULLABLE); break; + case ::substrait::proto::Type::kPrecisionTimestamp: + type->mutable_precision_timestamp()->set_nullability( + ::substrait::proto::Type_Nullability_NULLABILITY_NULLABLE); + break; + case ::substrait::proto::Type::kPrecisionTimestampTz: + type->mutable_precision_timestamp_tz()->set_nullability( + ::substrait::proto::Type_Nullability_NULLABILITY_NULLABLE); + break; case ::substrait::proto::Type::kUserDefinedTypeReference: case ::substrait::proto::Type::KIND_NOT_SET: // We are guaranteed to have a valid type so no need to emit an error. @@ -2278,3 +2293,6 @@ bool SubstraitPlanSubqueryRelationVisitor::isWithinSubquery( } } // namespace io::substrait::textplan + +#pragma clang diagnostic pop +#pragma gcc diagnostic pop diff --git a/src/substrait/textplan/parser/SubstraitPlanTypeVisitor.cpp b/src/substrait/textplan/parser/SubstraitPlanTypeVisitor.cpp index 5b42d817..b6131ae7 100644 --- a/src/substrait/textplan/parser/SubstraitPlanTypeVisitor.cpp +++ b/src/substrait/textplan/parser/SubstraitPlanTypeVisitor.cpp @@ -9,6 +9,13 @@ #include "substrait/textplan/SymbolTable.h" #include "substrait/type/Type.h" +// The visitor should try and be tolerant of older plans. This +// requires calling deprecated APIs. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#pragma gcc diagnostic push +#pragma gcc diagnostic ignored "-Wdeprecated-declarations" + namespace io::substrait::textplan { std::any SubstraitPlanTypeVisitor::visitLiteral_basic_type( @@ -202,3 +209,6 @@ bool SubstraitPlanTypeVisitor::insideStructLiteralWithExternalType( } } // namespace io::substrait::textplan + +#pragma clang diagnostic pop +#pragma gcc diagnostic pop diff --git a/third_party/substrait b/third_party/substrait index 47344783..5e1948e7 160000 --- a/third_party/substrait +++ b/third_party/substrait @@ -1 +1 @@ -Subproject commit 47344783dce74645dcb636cb646cd3628df37ef0 +Subproject commit 5e1948e7a9e945d347b011e6518d1bb501f8522a