Skip to content
This repository has been archived by the owner on Jan 7, 2025. It is now read-only.

Commit

Permalink
docs: update license and add license header
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Chi <[email protected]>
  • Loading branch information
github-actions[bot] authored and skyzh committed Nov 7, 2024
1 parent 9ff5a60 commit b630284
Show file tree
Hide file tree
Showing 115 changed files with 571 additions and 1 deletion.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions datafusion-optd-cli/src/command.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions datafusion-optd-cli/src/exec.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions datafusion-optd-cli/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions datafusion-optd-cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions optd-adaptive-demo/src/bin/optd-adaptive-three-join.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
5 changes: 5 additions & 0 deletions optd-adaptive-demo/src/bin/optd-adaptive-tpch-q8.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
5 changes: 5 additions & 0 deletions optd-core/src/cascades.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
5 changes: 5 additions & 0 deletions optd-core/src/cascades/memo.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
5 changes: 5 additions & 0 deletions optd-core/src/cascades/optimizer.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
5 changes: 5 additions & 0 deletions optd-core/src/cascades/tasks.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
5 changes: 5 additions & 0 deletions optd-core/src/cascades/tasks/apply_rule.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
5 changes: 5 additions & 0 deletions optd-core/src/cascades/tasks/explore_group.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
5 changes: 5 additions & 0 deletions optd-core/src/cascades/tasks/optimize_expression.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
5 changes: 5 additions & 0 deletions optd-core/src/cascades/tasks/optimize_group.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
5 changes: 5 additions & 0 deletions optd-core/src/cascades/tasks/optimize_inputs.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
5 changes: 5 additions & 0 deletions optd-core/src/cost.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down
5 changes: 5 additions & 0 deletions optd-core/src/heuristics.rs
Original file line number Diff line number Diff line change
@@ -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};
5 changes: 5 additions & 0 deletions optd-core/src/heuristics/optimizer.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
5 changes: 5 additions & 0 deletions optd-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
5 changes: 5 additions & 0 deletions optd-core/src/nodes.rs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
5 changes: 5 additions & 0 deletions optd-core/src/optimizer.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
5 changes: 5 additions & 0 deletions optd-core/src/property.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down
5 changes: 5 additions & 0 deletions optd-core/src/rules.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
5 changes: 5 additions & 0 deletions optd-core/src/rules/ir.rs
Original file line number Diff line number Diff line change
@@ -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<T: NodeType> {
Expand Down
5 changes: 5 additions & 0 deletions optd-datafusion-bridge/src/from_optd.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
5 changes: 5 additions & 0 deletions optd-datafusion-bridge/src/into_optd.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
5 changes: 5 additions & 0 deletions optd-datafusion-bridge/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
5 changes: 5 additions & 0 deletions optd-datafusion-bridge/src/physical_collector.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down
5 changes: 5 additions & 0 deletions optd-datafusion-repr-adv-cost/src/adv_stats.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
5 changes: 5 additions & 0 deletions optd-datafusion-repr-adv-cost/src/adv_stats/agg.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
5 changes: 5 additions & 0 deletions optd-datafusion-repr-adv-cost/src/adv_stats/filter.rs
Original file line number Diff line number Diff line change
@@ -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::{
Expand Down
5 changes: 5 additions & 0 deletions optd-datafusion-repr-adv-cost/src/adv_stats/filter/in_list.rs
Original file line number Diff line number Diff line change
@@ -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,
};
Expand Down
5 changes: 5 additions & 0 deletions optd-datafusion-repr-adv-cost/src/adv_stats/filter/like.rs
Original file line number Diff line number Diff line change
@@ -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::{
Expand Down
5 changes: 5 additions & 0 deletions optd-datafusion-repr-adv-cost/src/adv_stats/join.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
5 changes: 5 additions & 0 deletions optd-datafusion-repr-adv-cost/src/adv_stats/limit.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
5 changes: 5 additions & 0 deletions optd-datafusion-repr-adv-cost/src/adv_stats/stats.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
5 changes: 5 additions & 0 deletions optd-datafusion-repr-adv-cost/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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::{
Expand Down
5 changes: 5 additions & 0 deletions optd-datafusion-repr/src/cost.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
5 changes: 5 additions & 0 deletions optd-datafusion-repr/src/cost/adaptive_cost.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down
5 changes: 5 additions & 0 deletions optd-datafusion-repr/src/cost/base_cost.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
5 changes: 5 additions & 0 deletions optd-datafusion-repr/src/explain.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
5 changes: 5 additions & 0 deletions optd-datafusion-repr/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
5 changes: 5 additions & 0 deletions optd-datafusion-repr/src/memo_ext.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
Loading

0 comments on commit b630284

Please sign in to comment.