diff --git a/LICENSE b/LICENSE index 55808fb5..2f5af69a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 CMU Database Group +Copyright (c) 2023-2024 CMU Database Group Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/datafusion-optd-cli/src/command.rs b/datafusion-optd-cli/src/command.rs index 90c16a92..290804c9 100644 --- a/datafusion-optd-cli/src/command.rs +++ b/datafusion-optd-cli/src/command.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + // Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information diff --git a/datafusion-optd-cli/src/exec.rs b/datafusion-optd-cli/src/exec.rs index 86f9d309..0b14ef4f 100644 --- a/datafusion-optd-cli/src/exec.rs +++ b/datafusion-optd-cli/src/exec.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + // Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information diff --git a/datafusion-optd-cli/src/lib.rs b/datafusion-optd-cli/src/lib.rs index 7eb3cb51..8b4bda29 100644 --- a/datafusion-optd-cli/src/lib.rs +++ b/datafusion-optd-cli/src/lib.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + // Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information diff --git a/datafusion-optd-cli/src/main.rs b/datafusion-optd-cli/src/main.rs index 520884f4..d59d4147 100644 --- a/datafusion-optd-cli/src/main.rs +++ b/datafusion-optd-cli/src/main.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + // Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information diff --git a/optd-adaptive-demo/src/bin/optd-adaptive-three-join.rs b/optd-adaptive-demo/src/bin/optd-adaptive-three-join.rs index 74b75595..3898a759 100644 --- a/optd-adaptive-demo/src/bin/optd-adaptive-three-join.rs +++ b/optd-adaptive-demo/src/bin/optd-adaptive-three-join.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::sync::Arc; use console::Style; diff --git a/optd-adaptive-demo/src/bin/optd-adaptive-tpch-q8.rs b/optd-adaptive-demo/src/bin/optd-adaptive-tpch-q8.rs index f731391c..8be5af97 100644 --- a/optd-adaptive-demo/src/bin/optd-adaptive-tpch-q8.rs +++ b/optd-adaptive-demo/src/bin/optd-adaptive-tpch-q8.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::sync::Arc; use std::time::Duration; diff --git a/optd-core/src/cascades.rs b/optd-core/src/cascades.rs index e69486e1..2325f00b 100644 --- a/optd-core/src/cascades.rs +++ b/optd-core/src/cascades.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + //! The core cascades optimizer implementation. mod memo; diff --git a/optd-core/src/cascades/memo.rs b/optd-core/src/cascades/memo.rs index adf81239..142ca11b 100644 --- a/optd-core/src/cascades/memo.rs +++ b/optd-core/src/cascades/memo.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::any::Any; use std::collections::hash_map::Entry; use std::collections::{HashMap, HashSet}; diff --git a/optd-core/src/cascades/optimizer.rs b/optd-core/src/cascades/optimizer.rs index 993fd7c7..dd6d5f34 100644 --- a/optd-core/src/cascades/optimizer.rs +++ b/optd-core/src/cascades/optimizer.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::collections::{BTreeSet, HashMap, HashSet, VecDeque}; use std::fmt::Display; use std::sync::Arc; diff --git a/optd-core/src/cascades/tasks.rs b/optd-core/src/cascades/tasks.rs index 412f97f7..07d3205a 100644 --- a/optd-core/src/cascades/tasks.rs +++ b/optd-core/src/cascades/tasks.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use anyhow::Result; use super::{CascadesOptimizer, Memo}; diff --git a/optd-core/src/cascades/tasks/apply_rule.rs b/optd-core/src/cascades/tasks/apply_rule.rs index 236c9bfd..2db820ff 100644 --- a/optd-core/src/cascades/tasks/apply_rule.rs +++ b/optd-core/src/cascades/tasks/apply_rule.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::sync::Arc; use anyhow::Result; diff --git a/optd-core/src/cascades/tasks/explore_group.rs b/optd-core/src/cascades/tasks/explore_group.rs index 87637089..f2a47daa 100644 --- a/optd-core/src/cascades/tasks/explore_group.rs +++ b/optd-core/src/cascades/tasks/explore_group.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use anyhow::Result; use tracing::trace; diff --git a/optd-core/src/cascades/tasks/optimize_expression.rs b/optd-core/src/cascades/tasks/optimize_expression.rs index b37155bb..9c900e90 100644 --- a/optd-core/src/cascades/tasks/optimize_expression.rs +++ b/optd-core/src/cascades/tasks/optimize_expression.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use anyhow::Result; use tracing::trace; diff --git a/optd-core/src/cascades/tasks/optimize_group.rs b/optd-core/src/cascades/tasks/optimize_group.rs index e119e18f..2863af8c 100644 --- a/optd-core/src/cascades/tasks/optimize_group.rs +++ b/optd-core/src/cascades/tasks/optimize_group.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use anyhow::Result; use tracing::trace; diff --git a/optd-core/src/cascades/tasks/optimize_inputs.rs b/optd-core/src/cascades/tasks/optimize_inputs.rs index ab0a6be3..c8c5a958 100644 --- a/optd-core/src/cascades/tasks/optimize_inputs.rs +++ b/optd-core/src/cascades/tasks/optimize_inputs.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use anyhow::Result; use itertools::Itertools; use tracing::trace; diff --git a/optd-core/src/cost.rs b/optd-core/src/cost.rs index 3018d3b4..b7307414 100644 --- a/optd-core/src/cost.rs +++ b/optd-core/src/cost.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use crate::cascades::{CascadesOptimizer, Memo, RelNodeContext}; use crate::nodes::{ArcPredNode, NodeType}; diff --git a/optd-core/src/heuristics.rs b/optd-core/src/heuristics.rs index 84a63e11..26f83fb2 100644 --- a/optd-core/src/heuristics.rs +++ b/optd-core/src/heuristics.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + mod optimizer; pub use optimizer::{ApplyOrder, HeuristicsOptimizer}; diff --git a/optd-core/src/heuristics/optimizer.rs b/optd-core/src/heuristics/optimizer.rs index bf35a58f..dbd9f722 100644 --- a/optd-core/src/heuristics/optimizer.rs +++ b/optd-core/src/heuristics/optimizer.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::any::Any; use std::collections::HashMap; use std::sync::Arc; diff --git a/optd-core/src/lib.rs b/optd-core/src/lib.rs index 24ba051e..b6708b99 100644 --- a/optd-core/src/lib.rs +++ b/optd-core/src/lib.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + #![allow(clippy::new_without_default)] pub mod cascades; diff --git a/optd-core/src/nodes.rs b/optd-core/src/nodes.rs index c9b09742..3af1d8f7 100644 --- a/optd-core/src/nodes.rs +++ b/optd-core/src/nodes.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + //! The RelNode is the basic data structure of the optimizer. It is dynamically typed and is //! the internal representation of the plan nodes. diff --git a/optd-core/src/optimizer.rs b/optd-core/src/optimizer.rs index 46e075e8..89f14874 100644 --- a/optd-core/src/optimizer.rs +++ b/optd-core/src/optimizer.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use anyhow::Result; use crate::nodes::{ArcPlanNode, NodeType, PlanNodeOrGroup}; diff --git a/optd-core/src/property.rs b/optd-core/src/property.rs index 47e6cb8c..95445d6e 100644 --- a/optd-core/src/property.rs +++ b/optd-core/src/property.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::any::Any; use std::fmt::{Debug, Display}; diff --git a/optd-core/src/rules.rs b/optd-core/src/rules.rs index fef6c52f..0442eca1 100644 --- a/optd-core/src/rules.rs +++ b/optd-core/src/rules.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + mod ir; use std::fmt::{Display, Formatter}; diff --git a/optd-core/src/rules/ir.rs b/optd-core/src/rules/ir.rs index 6efc8a98..90a3b0b3 100644 --- a/optd-core/src/rules/ir.rs +++ b/optd-core/src/rules/ir.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use crate::nodes::NodeType; pub enum RuleMatcher { diff --git a/optd-datafusion-bridge/src/from_optd.rs b/optd-datafusion-bridge/src/from_optd.rs index 7ef0a723..5346a021 100644 --- a/optd-datafusion-bridge/src/from_optd.rs +++ b/optd-datafusion-bridge/src/from_optd.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::collections::HashMap; use std::sync::Arc; diff --git a/optd-datafusion-bridge/src/into_optd.rs b/optd-datafusion-bridge/src/into_optd.rs index 39e06f53..238a7a00 100644 --- a/optd-datafusion-bridge/src/into_optd.rs +++ b/optd-datafusion-bridge/src/into_optd.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use anyhow::{bail, Result}; use datafusion::common::DFSchema; use datafusion::logical_expr::{self, logical_plan, LogicalPlan, Operator}; diff --git a/optd-datafusion-bridge/src/lib.rs b/optd-datafusion-bridge/src/lib.rs index 1a9cccf7..d99d9d08 100644 --- a/optd-datafusion-bridge/src/lib.rs +++ b/optd-datafusion-bridge/src/lib.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + #![allow(clippy::new_without_default)] mod from_optd; diff --git a/optd-datafusion-bridge/src/physical_collector.rs b/optd-datafusion-bridge/src/physical_collector.rs index 9100b6e0..d2d10705 100644 --- a/optd-datafusion-bridge/src/physical_collector.rs +++ b/optd-datafusion-bridge/src/physical_collector.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::sync::Arc; use std::task::{Context, Poll}; diff --git a/optd-datafusion-repr-adv-cost/src/adv_stats.rs b/optd-datafusion-repr-adv-cost/src/adv_stats.rs index 8c39a136..952f0b6b 100644 --- a/optd-datafusion-repr-adv-cost/src/adv_stats.rs +++ b/optd-datafusion-repr-adv-cost/src/adv_stats.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + mod agg; mod filter; mod join; diff --git a/optd-datafusion-repr-adv-cost/src/adv_stats/agg.rs b/optd-datafusion-repr-adv-cost/src/adv_stats/agg.rs index c2b5cb57..0b457123 100644 --- a/optd-datafusion-repr-adv-cost/src/adv_stats/agg.rs +++ b/optd-datafusion-repr-adv-cost/src/adv_stats/agg.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use optd_datafusion_repr::plan_nodes::{ArcDfPredNode, DfReprPredNode, ListPred}; use optd_datafusion_repr::properties::column_ref::{ BaseTableColumnRef, ColumnRef, GroupColumnRefs, diff --git a/optd-datafusion-repr-adv-cost/src/adv_stats/filter.rs b/optd-datafusion-repr-adv-cost/src/adv_stats/filter.rs index 00a294ad..5850d59c 100644 --- a/optd-datafusion-repr-adv-cost/src/adv_stats/filter.rs +++ b/optd-datafusion-repr-adv-cost/src/adv_stats/filter.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::ops::Bound; use optd_datafusion_repr::plan_nodes::{ diff --git a/optd-datafusion-repr-adv-cost/src/adv_stats/filter/in_list.rs b/optd-datafusion-repr-adv-cost/src/adv_stats/filter/in_list.rs index 7e6a1210..869cf6a9 100644 --- a/optd-datafusion-repr-adv-cost/src/adv_stats/filter/in_list.rs +++ b/optd-datafusion-repr-adv-cost/src/adv_stats/filter/in_list.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use optd_datafusion_repr::plan_nodes::{ ColumnRefPred, ConstantPred, DfPredType, DfReprPredNode, InListPred, }; diff --git a/optd-datafusion-repr-adv-cost/src/adv_stats/filter/like.rs b/optd-datafusion-repr-adv-cost/src/adv_stats/filter/like.rs index 094ba5a6..825bab39 100644 --- a/optd-datafusion-repr-adv-cost/src/adv_stats/filter/like.rs +++ b/optd-datafusion-repr-adv-cost/src/adv_stats/filter/like.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use datafusion::arrow::array::StringArray; use datafusion::arrow::compute::like; use optd_datafusion_repr::plan_nodes::{ diff --git a/optd-datafusion-repr-adv-cost/src/adv_stats/join.rs b/optd-datafusion-repr-adv-cost/src/adv_stats/join.rs index b15d7f50..5aa8fb6c 100644 --- a/optd-datafusion-repr-adv-cost/src/adv_stats/join.rs +++ b/optd-datafusion-repr-adv-cost/src/adv_stats/join.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::collections::HashSet; use itertools::Itertools; diff --git a/optd-datafusion-repr-adv-cost/src/adv_stats/limit.rs b/optd-datafusion-repr-adv-cost/src/adv_stats/limit.rs index b5be86aa..ebb8c382 100644 --- a/optd-datafusion-repr-adv-cost/src/adv_stats/limit.rs +++ b/optd-datafusion-repr-adv-cost/src/adv_stats/limit.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use optd_datafusion_repr::plan_nodes::{ArcDfPredNode, ConstantPred, DfReprPredNode}; use serde::de::DeserializeOwned; use serde::Serialize; diff --git a/optd-datafusion-repr-adv-cost/src/adv_stats/stats.rs b/optd-datafusion-repr-adv-cost/src/adv_stats/stats.rs index 4953e0fb..fb66903c 100644 --- a/optd-datafusion-repr-adv-cost/src/adv_stats/stats.rs +++ b/optd-datafusion-repr-adv-cost/src/adv_stats/stats.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::collections::HashMap; use std::sync::Arc; diff --git a/optd-datafusion-repr-adv-cost/src/lib.rs b/optd-datafusion-repr-adv-cost/src/lib.rs index 40505641..2205ca8f 100644 --- a/optd-datafusion-repr-adv-cost/src/lib.rs +++ b/optd-datafusion-repr-adv-cost/src/lib.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::sync::{Arc, Mutex}; use adv_stats::stats::{ diff --git a/optd-datafusion-repr/src/cost.rs b/optd-datafusion-repr/src/cost.rs index be2468fa..c7c84f89 100644 --- a/optd-datafusion-repr/src/cost.rs +++ b/optd-datafusion-repr/src/cost.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + pub mod adaptive_cost; pub mod base_cost; diff --git a/optd-datafusion-repr/src/cost/adaptive_cost.rs b/optd-datafusion-repr/src/cost/adaptive_cost.rs index 7c2460c9..8a6c7b29 100644 --- a/optd-datafusion-repr/src/cost/adaptive_cost.rs +++ b/optd-datafusion-repr/src/cost/adaptive_cost.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::collections::HashMap; use std::sync::{Arc, Mutex}; diff --git a/optd-datafusion-repr/src/cost/base_cost.rs b/optd-datafusion-repr/src/cost/base_cost.rs index 9d4c2136..ad442094 100644 --- a/optd-datafusion-repr/src/cost/base_cost.rs +++ b/optd-datafusion-repr/src/cost/base_cost.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::collections::HashMap; use itertools::Itertools; diff --git a/optd-datafusion-repr/src/explain.rs b/optd-datafusion-repr/src/explain.rs index 179a06db..d7eaa686 100644 --- a/optd-datafusion-repr/src/explain.rs +++ b/optd-datafusion-repr/src/explain.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use optd_core::nodes::{PlanNodeMeta, PlanNodeMetaMap}; use pretty_xmlish::Pretty; diff --git a/optd-datafusion-repr/src/lib.rs b/optd-datafusion-repr/src/lib.rs index 0866c43b..e18af468 100644 --- a/optd-datafusion-repr/src/lib.rs +++ b/optd-datafusion-repr/src/lib.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + #![allow(clippy::new_without_default)] use std::collections::HashMap; diff --git a/optd-datafusion-repr/src/memo_ext.rs b/optd-datafusion-repr/src/memo_ext.rs index eee82082..642dd711 100644 --- a/optd-datafusion-repr/src/memo_ext.rs +++ b/optd-datafusion-repr/src/memo_ext.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + //! Memo table extensions use std::collections::{BTreeSet, HashMap}; diff --git a/optd-datafusion-repr/src/optimizer_ext.rs b/optd-datafusion-repr/src/optimizer_ext.rs index 7e7eaa21..64191c6c 100644 --- a/optd-datafusion-repr/src/optimizer_ext.rs +++ b/optd-datafusion-repr/src/optimizer_ext.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use optd_core::nodes::PlanNodeOrGroup; use optd_core::optimizer::Optimizer; diff --git a/optd-datafusion-repr/src/plan_nodes.rs b/optd-datafusion-repr/src/plan_nodes.rs index 225aeab3..72f1a766 100644 --- a/optd-datafusion-repr/src/plan_nodes.rs +++ b/optd-datafusion-repr/src/plan_nodes.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + //! Typed interface of plan nodes. mod agg; diff --git a/optd-datafusion-repr/src/plan_nodes/agg.rs b/optd-datafusion-repr/src/plan_nodes/agg.rs index 645ac49c..e9e22edf 100644 --- a/optd-datafusion-repr/src/plan_nodes/agg.rs +++ b/optd-datafusion-repr/src/plan_nodes/agg.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use super::macros::define_plan_node; use super::predicates::ListPred; use super::{ArcDfPlanNode, DfNodeType, DfPlanNode, DfReprPlanNode}; diff --git a/optd-datafusion-repr/src/plan_nodes/empty_relation.rs b/optd-datafusion-repr/src/plan_nodes/empty_relation.rs index 9eb490c6..dedc42ff 100644 --- a/optd-datafusion-repr/src/plan_nodes/empty_relation.rs +++ b/optd-datafusion-repr/src/plan_nodes/empty_relation.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::sync::Arc; use bincode; diff --git a/optd-datafusion-repr/src/plan_nodes/filter.rs b/optd-datafusion-repr/src/plan_nodes/filter.rs index 64619629..7c08a9bd 100644 --- a/optd-datafusion-repr/src/plan_nodes/filter.rs +++ b/optd-datafusion-repr/src/plan_nodes/filter.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use super::macros::define_plan_node; use super::{ArcDfPlanNode, ArcDfPredNode, DfNodeType, DfPlanNode, DfReprPlanNode}; diff --git a/optd-datafusion-repr/src/plan_nodes/join.rs b/optd-datafusion-repr/src/plan_nodes/join.rs index dfcf4422..84dbc033 100644 --- a/optd-datafusion-repr/src/plan_nodes/join.rs +++ b/optd-datafusion-repr/src/plan_nodes/join.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use core::fmt; use std::fmt::Display; diff --git a/optd-datafusion-repr/src/plan_nodes/limit.rs b/optd-datafusion-repr/src/plan_nodes/limit.rs index d35bf2e0..b71ef7d4 100644 --- a/optd-datafusion-repr/src/plan_nodes/limit.rs +++ b/optd-datafusion-repr/src/plan_nodes/limit.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use super::macros::define_plan_node; use super::{ArcDfPlanNode, ArcDfPredNode, DfNodeType, DfPlanNode, DfReprPlanNode}; diff --git a/optd-datafusion-repr/src/plan_nodes/macros.rs b/optd-datafusion-repr/src/plan_nodes/macros.rs index 5cd0645b..a674ec1e 100644 --- a/optd-datafusion-repr/src/plan_nodes/macros.rs +++ b/optd-datafusion-repr/src/plan_nodes/macros.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + macro_rules! define_plan_node { ( $struct_name:ident : $meta_typ:tt, diff --git a/optd-datafusion-repr/src/plan_nodes/predicates.rs b/optd-datafusion-repr/src/plan_nodes/predicates.rs index da3f22e2..895c4469 100644 --- a/optd-datafusion-repr/src/plan_nodes/predicates.rs +++ b/optd-datafusion-repr/src/plan_nodes/predicates.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + mod between_pred; mod bin_op_pred; mod cast_pred; diff --git a/optd-datafusion-repr/src/plan_nodes/predicates/between_pred.rs b/optd-datafusion-repr/src/plan_nodes/predicates/between_pred.rs index 38babffc..04ae48ac 100644 --- a/optd-datafusion-repr/src/plan_nodes/predicates/between_pred.rs +++ b/optd-datafusion-repr/src/plan_nodes/predicates/between_pred.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use optd_core::nodes::PlanNodeMetaMap; use pretty_xmlish::Pretty; diff --git a/optd-datafusion-repr/src/plan_nodes/predicates/bin_op_pred.rs b/optd-datafusion-repr/src/plan_nodes/predicates/bin_op_pred.rs index 22f3a660..a96230f0 100644 --- a/optd-datafusion-repr/src/plan_nodes/predicates/bin_op_pred.rs +++ b/optd-datafusion-repr/src/plan_nodes/predicates/bin_op_pred.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use optd_core::nodes::PlanNodeMetaMap; use pretty_xmlish::Pretty; diff --git a/optd-datafusion-repr/src/plan_nodes/predicates/cast_pred.rs b/optd-datafusion-repr/src/plan_nodes/predicates/cast_pred.rs index d1245023..cb8163e8 100644 --- a/optd-datafusion-repr/src/plan_nodes/predicates/cast_pred.rs +++ b/optd-datafusion-repr/src/plan_nodes/predicates/cast_pred.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use arrow_schema::DataType; use optd_core::nodes::PlanNodeMetaMap; use pretty_xmlish::Pretty; diff --git a/optd-datafusion-repr/src/plan_nodes/predicates/column_ref_pred.rs b/optd-datafusion-repr/src/plan_nodes/predicates/column_ref_pred.rs index 9e061455..347110df 100644 --- a/optd-datafusion-repr/src/plan_nodes/predicates/column_ref_pred.rs +++ b/optd-datafusion-repr/src/plan_nodes/predicates/column_ref_pred.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use optd_core::nodes::{PlanNodeMetaMap, Value}; use pretty_xmlish::Pretty; diff --git a/optd-datafusion-repr/src/plan_nodes/predicates/constant_pred.rs b/optd-datafusion-repr/src/plan_nodes/predicates/constant_pred.rs index 2a10afb1..c95c10e5 100644 --- a/optd-datafusion-repr/src/plan_nodes/predicates/constant_pred.rs +++ b/optd-datafusion-repr/src/plan_nodes/predicates/constant_pred.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::sync::Arc; use arrow_schema::{DataType, IntervalUnit}; diff --git a/optd-datafusion-repr/src/plan_nodes/predicates/data_type_pred.rs b/optd-datafusion-repr/src/plan_nodes/predicates/data_type_pred.rs index b96fd890..f9493dc3 100644 --- a/optd-datafusion-repr/src/plan_nodes/predicates/data_type_pred.rs +++ b/optd-datafusion-repr/src/plan_nodes/predicates/data_type_pred.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use arrow_schema::DataType; use optd_core::nodes::PlanNodeMetaMap; use pretty_xmlish::Pretty; diff --git a/optd-datafusion-repr/src/plan_nodes/predicates/extern_column_ref_pred.rs b/optd-datafusion-repr/src/plan_nodes/predicates/extern_column_ref_pred.rs index 991bf834..49a83093 100644 --- a/optd-datafusion-repr/src/plan_nodes/predicates/extern_column_ref_pred.rs +++ b/optd-datafusion-repr/src/plan_nodes/predicates/extern_column_ref_pred.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use optd_core::nodes::{PlanNodeMetaMap, Value}; use pretty_xmlish::Pretty; diff --git a/optd-datafusion-repr/src/plan_nodes/predicates/func_pred.rs b/optd-datafusion-repr/src/plan_nodes/predicates/func_pred.rs index 98fb7c3f..b61e1e53 100644 --- a/optd-datafusion-repr/src/plan_nodes/predicates/func_pred.rs +++ b/optd-datafusion-repr/src/plan_nodes/predicates/func_pred.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use optd_core::nodes::PlanNodeMetaMap; use pretty_xmlish::Pretty; diff --git a/optd-datafusion-repr/src/plan_nodes/predicates/in_list_pred.rs b/optd-datafusion-repr/src/plan_nodes/predicates/in_list_pred.rs index d3625f31..30971c22 100644 --- a/optd-datafusion-repr/src/plan_nodes/predicates/in_list_pred.rs +++ b/optd-datafusion-repr/src/plan_nodes/predicates/in_list_pred.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use optd_core::nodes::{PlanNodeMetaMap, Value}; use pretty_xmlish::Pretty; diff --git a/optd-datafusion-repr/src/plan_nodes/predicates/like_pred.rs b/optd-datafusion-repr/src/plan_nodes/predicates/like_pred.rs index 840f8f74..d2b32340 100644 --- a/optd-datafusion-repr/src/plan_nodes/predicates/like_pred.rs +++ b/optd-datafusion-repr/src/plan_nodes/predicates/like_pred.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::sync::Arc; use optd_core::nodes::{PlanNodeMetaMap, Value}; diff --git a/optd-datafusion-repr/src/plan_nodes/predicates/list_pred.rs b/optd-datafusion-repr/src/plan_nodes/predicates/list_pred.rs index ff95ddc7..d032fd71 100644 --- a/optd-datafusion-repr/src/plan_nodes/predicates/list_pred.rs +++ b/optd-datafusion-repr/src/plan_nodes/predicates/list_pred.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use itertools::Itertools; use optd_core::nodes::PlanNodeMetaMap; use pretty_xmlish::Pretty; diff --git a/optd-datafusion-repr/src/plan_nodes/predicates/log_op_pred.rs b/optd-datafusion-repr/src/plan_nodes/predicates/log_op_pred.rs index 34cc1853..73517caf 100644 --- a/optd-datafusion-repr/src/plan_nodes/predicates/log_op_pred.rs +++ b/optd-datafusion-repr/src/plan_nodes/predicates/log_op_pred.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::fmt::Display; use optd_core::nodes::PlanNodeMetaMap; diff --git a/optd-datafusion-repr/src/plan_nodes/predicates/sort_order_pred.rs b/optd-datafusion-repr/src/plan_nodes/predicates/sort_order_pred.rs index 43ac4037..4e34e50f 100644 --- a/optd-datafusion-repr/src/plan_nodes/predicates/sort_order_pred.rs +++ b/optd-datafusion-repr/src/plan_nodes/predicates/sort_order_pred.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::fmt::Display; use optd_core::nodes::PlanNodeMetaMap; diff --git a/optd-datafusion-repr/src/plan_nodes/predicates/un_op_pred.rs b/optd-datafusion-repr/src/plan_nodes/predicates/un_op_pred.rs index 1ae08e48..8cc592f5 100644 --- a/optd-datafusion-repr/src/plan_nodes/predicates/un_op_pred.rs +++ b/optd-datafusion-repr/src/plan_nodes/predicates/un_op_pred.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::fmt::Display; use optd_core::nodes::PlanNodeMetaMap; diff --git a/optd-datafusion-repr/src/plan_nodes/projection.rs b/optd-datafusion-repr/src/plan_nodes/projection.rs index 1697806c..8a1a079a 100644 --- a/optd-datafusion-repr/src/plan_nodes/projection.rs +++ b/optd-datafusion-repr/src/plan_nodes/projection.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use super::macros::define_plan_node; use super::{ArcDfPlanNode, DfNodeType, DfPlanNode, DfReprPlanNode, ListPred}; diff --git a/optd-datafusion-repr/src/plan_nodes/scan.rs b/optd-datafusion-repr/src/plan_nodes/scan.rs index 6a0f0fec..a93baa67 100644 --- a/optd-datafusion-repr/src/plan_nodes/scan.rs +++ b/optd-datafusion-repr/src/plan_nodes/scan.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::sync::Arc; use optd_core::nodes::PlanNodeMetaMap; diff --git a/optd-datafusion-repr/src/plan_nodes/sort.rs b/optd-datafusion-repr/src/plan_nodes/sort.rs index 2558ea60..aef3427a 100644 --- a/optd-datafusion-repr/src/plan_nodes/sort.rs +++ b/optd-datafusion-repr/src/plan_nodes/sort.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use super::macros::define_plan_node; use super::{ArcDfPlanNode, DfNodeType, DfPlanNode, DfReprPlanNode, ListPred}; diff --git a/optd-datafusion-repr/src/plan_nodes/subquery.rs b/optd-datafusion-repr/src/plan_nodes/subquery.rs index aebf9379..abd400bc 100644 --- a/optd-datafusion-repr/src/plan_nodes/subquery.rs +++ b/optd-datafusion-repr/src/plan_nodes/subquery.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use super::macros::define_plan_node; use super::{ ArcDfPlanNode, ArcDfPredNode, DfNodeType, DfPlanNode, DfReprPlanNode, JoinType, ListPred, diff --git a/optd-datafusion-repr/src/properties.rs b/optd-datafusion-repr/src/properties.rs index 0e0af840..98004f8f 100644 --- a/optd-datafusion-repr/src/properties.rs +++ b/optd-datafusion-repr/src/properties.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + pub mod column_ref; pub mod schema; diff --git a/optd-datafusion-repr/src/properties/column_ref.rs b/optd-datafusion-repr/src/properties/column_ref.rs index 117ebf2c..7141af96 100644 --- a/optd-datafusion-repr/src/properties/column_ref.rs +++ b/optd-datafusion-repr/src/properties/column_ref.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::collections::HashSet; use std::ops::Deref; use std::sync::Arc; diff --git a/optd-datafusion-repr/src/properties/schema.rs b/optd-datafusion-repr/src/properties/schema.rs index 5f359ce5..3055e373 100644 --- a/optd-datafusion-repr/src/properties/schema.rs +++ b/optd-datafusion-repr/src/properties/schema.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::sync::Arc; use itertools::Itertools; diff --git a/optd-datafusion-repr/src/rules.rs b/optd-datafusion-repr/src/rules.rs index 8e792b31..20f883c3 100644 --- a/optd-datafusion-repr/src/rules.rs +++ b/optd-datafusion-repr/src/rules.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + mod eliminate_duplicated_expr; mod eliminate_limit; mod filter; diff --git a/optd-datafusion-repr/src/rules/eliminate_duplicated_expr.rs b/optd-datafusion-repr/src/rules/eliminate_duplicated_expr.rs index 082e5ecb..4ec00947 100644 --- a/optd-datafusion-repr/src/rules/eliminate_duplicated_expr.rs +++ b/optd-datafusion-repr/src/rules/eliminate_duplicated_expr.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::collections::HashSet; use optd_core::nodes::PlanNodeOrGroup; diff --git a/optd-datafusion-repr/src/rules/eliminate_limit.rs b/optd-datafusion-repr/src/rules/eliminate_limit.rs index 64903bd2..c1968dce 100644 --- a/optd-datafusion-repr/src/rules/eliminate_limit.rs +++ b/optd-datafusion-repr/src/rules/eliminate_limit.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use optd_core::nodes::PlanNodeOrGroup; use optd_core::optimizer::Optimizer; use optd_core::rules::{Rule, RuleMatcher}; diff --git a/optd-datafusion-repr/src/rules/filter.rs b/optd-datafusion-repr/src/rules/filter.rs index f6318155..77c85419 100644 --- a/optd-datafusion-repr/src/rules/filter.rs +++ b/optd-datafusion-repr/src/rules/filter.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::collections::HashSet; use optd_core::nodes::PlanNodeOrGroup; diff --git a/optd-datafusion-repr/src/rules/filter_pushdown.rs b/optd-datafusion-repr/src/rules/filter_pushdown.rs index 15608963..30c0d0b2 100644 --- a/optd-datafusion-repr/src/rules/filter_pushdown.rs +++ b/optd-datafusion-repr/src/rules/filter_pushdown.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + //! This rule is designed to be applied heuristically (read: all the time, blindly). //! However, pushing a filter is not *always* better (but it usually is). If cost is //! to be taken into account, each transposition step can be done separately diff --git a/optd-datafusion-repr/src/rules/joins.rs b/optd-datafusion-repr/src/rules/joins.rs index d8355e2a..5a7fdbc3 100644 --- a/optd-datafusion-repr/src/rules/joins.rs +++ b/optd-datafusion-repr/src/rules/joins.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::vec; use optd_core::nodes::PlanNodeOrGroup; diff --git a/optd-datafusion-repr/src/rules/macros.rs b/optd-datafusion-repr/src/rules/macros.rs index c3928140..47703e66 100644 --- a/optd-datafusion-repr/src/rules/macros.rs +++ b/optd-datafusion-repr/src/rules/macros.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + macro_rules! define_matcher { ( ( $typ:expr $(, $children:tt )* ) ) => { RuleMatcher::MatchNode { diff --git a/optd-datafusion-repr/src/rules/physical.rs b/optd-datafusion-repr/src/rules/physical.rs index a5497d44..2bbfa0e6 100644 --- a/optd-datafusion-repr/src/rules/physical.rs +++ b/optd-datafusion-repr/src/rules/physical.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::sync::Arc; use optd_core::nodes::{PlanNode, PlanNodeOrGroup}; diff --git a/optd-datafusion-repr/src/rules/project_transpose.rs b/optd-datafusion-repr/src/rules/project_transpose.rs index 14be13d5..b18f2019 100644 --- a/optd-datafusion-repr/src/rules/project_transpose.rs +++ b/optd-datafusion-repr/src/rules/project_transpose.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + pub mod project_filter_transpose; pub mod project_join_transpose; pub mod project_merge; diff --git a/optd-datafusion-repr/src/rules/project_transpose/project_filter_transpose.rs b/optd-datafusion-repr/src/rules/project_transpose/project_filter_transpose.rs index 7de4c1c0..a31da316 100644 --- a/optd-datafusion-repr/src/rules/project_transpose/project_filter_transpose.rs +++ b/optd-datafusion-repr/src/rules/project_transpose/project_filter_transpose.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::vec; use itertools::Itertools; diff --git a/optd-datafusion-repr/src/rules/project_transpose/project_join_transpose.rs b/optd-datafusion-repr/src/rules/project_transpose/project_join_transpose.rs index b1e0986c..dfe8cb79 100644 --- a/optd-datafusion-repr/src/rules/project_transpose/project_join_transpose.rs +++ b/optd-datafusion-repr/src/rules/project_transpose/project_join_transpose.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::vec; use optd_core::nodes::PlanNodeOrGroup; diff --git a/optd-datafusion-repr/src/rules/project_transpose/project_merge.rs b/optd-datafusion-repr/src/rules/project_transpose/project_merge.rs index e73e3927..7b290645 100644 --- a/optd-datafusion-repr/src/rules/project_transpose/project_merge.rs +++ b/optd-datafusion-repr/src/rules/project_transpose/project_merge.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use optd_core::nodes::PlanNodeOrGroup; use optd_core::optimizer::Optimizer; use optd_core::rules::{Rule, RuleMatcher}; diff --git a/optd-datafusion-repr/src/rules/project_transpose/project_transpose_common.rs b/optd-datafusion-repr/src/rules/project_transpose/project_transpose_common.rs index 8cf0eaa3..b973c7a2 100644 --- a/optd-datafusion-repr/src/rules/project_transpose/project_transpose_common.rs +++ b/optd-datafusion-repr/src/rules/project_transpose/project_transpose_common.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use crate::plan_nodes::{ArcDfPredNode, ColumnRefPred, DfReprPredNode, ListPred, PredExt}; /// This struct holds the mapping from original columns to projected columns. diff --git a/optd-datafusion-repr/src/rules/subquery.rs b/optd-datafusion-repr/src/rules/subquery.rs index b6e0bf84..17a6e0a6 100644 --- a/optd-datafusion-repr/src/rules/subquery.rs +++ b/optd-datafusion-repr/src/rules/subquery.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + pub mod depjoin_pushdown; pub use depjoin_pushdown::{ diff --git a/optd-datafusion-repr/src/rules/subquery/depjoin_pushdown.rs b/optd-datafusion-repr/src/rules/subquery/depjoin_pushdown.rs index 206bc9ba..6e60f122 100644 --- a/optd-datafusion-repr/src/rules/subquery/depjoin_pushdown.rs +++ b/optd-datafusion-repr/src/rules/subquery/depjoin_pushdown.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use optd_core::nodes::{PlanNodeOrGroup, PredNode}; // TODO: No push past join // TODO: Sideways information passing?? diff --git a/optd-datafusion-repr/src/testing.rs b/optd-datafusion-repr/src/testing.rs index b5f26e7d..a9526d65 100644 --- a/optd-datafusion-repr/src/testing.rs +++ b/optd-datafusion-repr/src/testing.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + mod dummy_cost; mod tpch_catalog; diff --git a/optd-datafusion-repr/src/testing/dummy_cost.rs b/optd-datafusion-repr/src/testing/dummy_cost.rs index 3aac5d3c..5cafc276 100644 --- a/optd-datafusion-repr/src/testing/dummy_cost.rs +++ b/optd-datafusion-repr/src/testing/dummy_cost.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use optd_core::cascades::{CascadesOptimizer, NaiveMemo, RelNodeContext}; use optd_core::cost::{Cost, CostModel, Statistics}; use value_bag::ValueBag; diff --git a/optd-datafusion-repr/src/testing/tpch_catalog.rs b/optd-datafusion-repr/src/testing/tpch_catalog.rs index 41e2ea24..81023474 100644 --- a/optd-datafusion-repr/src/testing/tpch_catalog.rs +++ b/optd-datafusion-repr/src/testing/tpch_catalog.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use core::panic; use crate::plan_nodes::ConstantType; diff --git a/optd-gungnir/src/lib.rs b/optd-gungnir/src/lib.rs index 759fe93b..f0b07635 100644 --- a/optd-gungnir/src/lib.rs +++ b/optd-gungnir/src/lib.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + #![allow(clippy::new_without_default)] pub mod stats; diff --git a/optd-gungnir/src/stats.rs b/optd-gungnir/src/stats.rs index 69a60d4b..b32315af 100644 --- a/optd-gungnir/src/stats.rs +++ b/optd-gungnir/src/stats.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + pub mod counter; pub mod hyperloglog; pub mod misragries; diff --git a/optd-gungnir/src/stats/counter.rs b/optd-gungnir/src/stats/counter.rs index 387ad36a..58d300c3 100644 --- a/optd-gungnir/src/stats/counter.rs +++ b/optd-gungnir/src/stats/counter.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + //! A hash-based Counter implementation that will track exact frequencies for //! an array of prespecified elements. diff --git a/optd-gungnir/src/stats/hyperloglog.rs b/optd-gungnir/src/stats/hyperloglog.rs index d2beff75..dae5973b 100644 --- a/optd-gungnir/src/stats/hyperloglog.rs +++ b/optd-gungnir/src/stats/hyperloglog.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + //! Implementation of the HyperLogLog data structure as described in Flajolet et al. paper: //! "HyperLogLog: the analysis of a near-optimal cardinality estimation algorithm" (2007). //! For more details, refer to: diff --git a/optd-gungnir/src/stats/misragries.rs b/optd-gungnir/src/stats/misragries.rs index d68c395b..5cd11e8a 100644 --- a/optd-gungnir/src/stats/misragries.rs +++ b/optd-gungnir/src/stats/misragries.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + //! Implementation of the Misra-Gries Summary data structure as described in //! the Cormode et al. paper: "Misra-Gries Summaries" (2014). //! We further refine the algorithm to ensure that K elements will always be diff --git a/optd-gungnir/src/stats/murmur2.rs b/optd-gungnir/src/stats/murmur2.rs index 7a27426b..b7de8e59 100644 --- a/optd-gungnir/src/stats/murmur2.rs +++ b/optd-gungnir/src/stats/murmur2.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + //! Implementation of the MurmurHash2 function, for 64b outputs, by Austin Appleby (2008). //! Note: Assumes little-endian machines. diff --git a/optd-gungnir/src/stats/tdigest.rs b/optd-gungnir/src/stats/tdigest.rs index 6273a103..83c9f289 100644 --- a/optd-gungnir/src/stats/tdigest.rs +++ b/optd-gungnir/src/stats/tdigest.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + //! Simplified implementation of the TDigest data structure as described in //! Ted Dunning's paper: //! "Computing Extremely Accurate Quantiles Using t-Digests" (2019). diff --git a/optd-gungnir/src/utils.rs b/optd-gungnir/src/utils.rs index 646eaff2..10a76ecc 100644 --- a/optd-gungnir/src/utils.rs +++ b/optd-gungnir/src/utils.rs @@ -1 +1,6 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + pub mod arith_encoder; diff --git a/optd-gungnir/src/utils/arith_encoder.rs b/optd-gungnir/src/utils/arith_encoder.rs index 855e6d20..ba96794d 100644 --- a/optd-gungnir/src/utils/arith_encoder.rs +++ b/optd-gungnir/src/utils/arith_encoder.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + //! This module provides an encoder that converts alpha-numeric strings //! into f64 values, designed to maintain the natural ordering of strings. //! diff --git a/optd-perfbench/src/benchmark.rs b/optd-perfbench/src/benchmark.rs index 623bebb4..cf1b11b4 100644 --- a/optd-perfbench/src/benchmark.rs +++ b/optd-perfbench/src/benchmark.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use serde::{Deserialize, Serialize}; use crate::job::JobKitConfig; diff --git a/optd-perfbench/src/cardbench.rs b/optd-perfbench/src/cardbench.rs index f1088419..ef2aa541 100644 --- a/optd-perfbench/src/cardbench.rs +++ b/optd-perfbench/src/cardbench.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::collections::HashMap; use std::path::Path; diff --git a/optd-perfbench/src/datafusion_dbms.rs b/optd-perfbench/src/datafusion_dbms.rs index dd15accb..2cf8e44c 100644 --- a/optd-perfbench/src/datafusion_dbms.rs +++ b/optd-perfbench/src/datafusion_dbms.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::fs::{self, File}; use std::path::{Path, PathBuf}; use std::sync::{Arc, Mutex}; diff --git a/optd-perfbench/src/job.rs b/optd-perfbench/src/job.rs index 18e6f391..22875dc2 100644 --- a/optd-perfbench/src/job.rs +++ b/optd-perfbench/src/job.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::fmt::{self, Display, Formatter}; use std::fs::File; use std::path::{Path, PathBuf}; diff --git a/optd-perfbench/src/lib.rs b/optd-perfbench/src/lib.rs index 3b4a99e3..163fa1a7 100644 --- a/optd-perfbench/src/lib.rs +++ b/optd-perfbench/src/lib.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + pub mod benchmark; pub mod cardbench; mod datafusion_dbms; diff --git a/optd-perfbench/src/main.rs b/optd-perfbench/src/main.rs index f486720c..107ca018 100644 --- a/optd-perfbench/src/main.rs +++ b/optd-perfbench/src/main.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::fs; use std::path::Path; diff --git a/optd-perfbench/src/postgres_dbms.rs b/optd-perfbench/src/postgres_dbms.rs index 1324ad76..abc652cc 100644 --- a/optd-perfbench/src/postgres_dbms.rs +++ b/optd-perfbench/src/postgres_dbms.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::fs; use std::io::Cursor; use std::path::{Path, PathBuf}; diff --git a/optd-perfbench/src/shell.rs b/optd-perfbench/src/shell.rs index 768af7ee..c14c129d 100644 --- a/optd-perfbench/src/shell.rs +++ b/optd-perfbench/src/shell.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::path::{Path, PathBuf}; use std::process::{Command, Output}; use std::{fs, io, str}; diff --git a/optd-perfbench/src/tpch.rs b/optd-perfbench/src/tpch.rs index b3f6bd45..dcf3e831 100644 --- a/optd-perfbench/src/tpch.rs +++ b/optd-perfbench/src/tpch.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::env::consts::OS; use std::fmt::{self, Display, Formatter}; use std::fs::File; diff --git a/optd-perfbench/src/truecard.rs b/optd-perfbench/src/truecard.rs index cd776bbb..7e14c263 100644 --- a/optd-perfbench/src/truecard.rs +++ b/optd-perfbench/src/truecard.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::collections::HashMap; use std::fs::{self, File}; use std::path::{Path, PathBuf}; diff --git a/optd-perfbench/tests/cardtest_integration.rs b/optd-perfbench/tests/cardtest_integration.rs index 85c83ff2..d2fa103f 100644 --- a/optd-perfbench/tests/cardtest_integration.rs +++ b/optd-perfbench/tests/cardtest_integration.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + #[cfg(test)] mod tests { use std::fs; diff --git a/optd-sqlplannertest/src/bin/planner_test_apply.rs b/optd-sqlplannertest/src/bin/planner_test_apply.rs index 0e76aa4e..f555bfba 100644 --- a/optd-sqlplannertest/src/bin/planner_test_apply.rs +++ b/optd-sqlplannertest/src/bin/planner_test_apply.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::path::Path; use anyhow::Result; diff --git a/optd-sqlplannertest/src/lib.rs b/optd-sqlplannertest/src/lib.rs index d69ce3c4..d96a6a66 100644 --- a/optd-sqlplannertest/src/lib.rs +++ b/optd-sqlplannertest/src/lib.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::collections::HashSet; use std::sync::Arc; diff --git a/optd-sqlplannertest/tests/planner_test.rs b/optd-sqlplannertest/tests/planner_test.rs index 5aa2476d..4e98fa64 100644 --- a/optd-sqlplannertest/tests/planner_test.rs +++ b/optd-sqlplannertest/tests/planner_test.rs @@ -1,3 +1,8 @@ +// Copyright (c) 2023-2024 CMU Database Group +// +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + use std::path::Path; use anyhow::Result;