Apache DataFusion SQL Query Engine
Ensure most of links in docs are correct (#1808)
Remzi Yang4cc8e44447e9
diff --git a/datafusion-expr/src/expr.rs b/datafusion-expr/src/expr.rsindex d3cbf7059b..e3924d9bdb 100644--- a/datafusion-expr/src/expr.rs+++ b/datafusion-expr/src/expr.rs@@ -106,7 +106,7 @@ pub enum Expr {IsNull(Box<Expr>),/// arithmetic negation of an expression, the operand must be of a signed numeric data typeNegative(Box<Expr>),- /// Returns the field of a [`ListArray`] or [`StructArray`] by key+ /// Returns the field of a [`arrow::array::ListArray`] or [`arrow::array::StructArray`] by keyGetIndexedField {/// the expression to take the field fromexpr: Box<Expr>,@@ -248,7 +248,7 @@ impl PartialOrd for Expr {}impl Expr {- /// Returns the name of this expression based on [crate::logical_plan::DFSchema].+ /// Returns the name of this expression based on [datafusion_common::DFSchema].////// This represents how a column with this expression is named when no alias is chosenpub fn name(&self, input_schema: &DFSchema) -> Result<String> {diff --git a/datafusion-expr/src/signature.rs b/datafusion-expr/src/signature.rsindex b347448f7e..3efe77e43e 100644--- a/datafusion-expr/src/signature.rs+++ b/datafusion-expr/src/signature.rs@@ -24,15 +24,15 @@ use arrow::datatypes::DataType;#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)]pub enum Volatility {/// Immutable - An immutable function will always return the same output when given the same- /// input. An example of this is [BuiltinScalarFunction::Cos].+ /// input. An example of this is [super::BuiltinScalarFunction::Cos].Immutable,/// Stable - A stable function may return different values given the same input across different/// queries but must return the same value for a given input within a query. An example of- /// this is [BuiltinScalarFunction::Now].+ /// this is [super::BuiltinScalarFunction::Now].Stable,/// Volatile - A volatile function may change the return value from evaluation to evaluation./// Multiple invocations of a volatile function may return different results when used in the- /// same query. An example of this is [BuiltinScalarFunction::Random].+ /// same query. An example of this is [super::BuiltinScalarFunction::Random].Volatile,}diff --git a/datafusion/src/catalog/information_schema.rs b/datafusion/src/catalog/information_schema.rsindex ba4ec09271..2fbf825563 100644--- a/datafusion/src/catalog/information_schema.rs+++ b/datafusion/src/catalog/information_schema.rs@@ -17,7 +17,7 @@//! Implements the SQL [Information Schema] for DataFusion.//!-//! Information Schema](https://en.wikipedia.org/wiki/Information_schema)+//! Information Schema]<https://en.wikipedia.org/wiki/Information_schema>use std::{any,@@ -195,7 +195,7 @@ impl SchemaProvider for InformationSchemaProvider {/// Builds the `information_schema.TABLE` table row by row///-/// Columns are based on https://www.postgresql.org/docs/current/infoschema-columns.html+/// Columns are based on <https://www.postgresql.org/docs/current/infoschema-columns.html>struct InformationSchemaTablesBuilder {catalog_names: StringBuilder,schema_names: StringBuilder,@@ -276,7 +276,7 @@ impl From<InformationSchemaTablesBuilder> for MemTable {/// Builds the `information_schema.COLUMNS` table row by row///-/// Columns are based on https://www.postgresql.org/docs/current/infoschema-columns.html+/// Columns are based on <https://www.postgresql.org/docs/current/infoschema-columns.html>struct InformationSchemaColumnsBuilder {catalog_names: StringBuilder,schema_names: StringBuilder,diff --git a/datafusion/src/datasource/object_store/mod.rs b/datafusion/src/datasource/object_store/mod.rsindex 4ca0d54c40..24bdaab55a 100644--- a/datafusion/src/datasource/object_store/mod.rs+++ b/datafusion/src/datasource/object_store/mod.rs@@ -90,7 +90,7 @@ pub struct FileMeta {/// The last modification time of the file according to the/// object store metadata. This information might be used by/// catalog systems like Delta Lake for time travel (see- /// https://github.com/delta-io/delta/issues/192)+ /// <https://github.com/delta-io/delta/issues/192>)pub last_modified: Option<DateTime<Utc>>,}diff --git a/datafusion/src/lib.rs b/datafusion/src/lib.rsindex 61afa09791..a9630c0f17 100644--- a/datafusion/src/lib.rs+++ b/datafusion/src/lib.rs@@ -159,7 +159,7 @@//! * Projection: [`ProjectionExec`](physical_plan::projection::ProjectionExec)//! * Filter: [`FilterExec`](physical_plan::filter::FilterExec)//! * Hash and Grouped aggregations: [`HashAggregateExec`](physical_plan::hash_aggregate::HashAggregateExec)-//! * Sort: [`SortExec`](physical_plan::sort::SortExec)+//! * Sort: [`SortExec`](physical_plan::sorts::sort::SortExec)//! * Coalesce partitions: [`CoalescePartitionsExec`](physical_plan::coalesce_partitions::CoalescePartitionsExec)//! * Limit: [`LocalLimitExec`](physical_plan::limit::LocalLimitExec) and [`GlobalLimitExec`](physical_plan::limit::GlobalLimitExec)//! * Scan a CSV: [`CsvExec`](physical_plan::file_format::CsvExec)diff --git a/datafusion/src/logical_plan/expr.rs b/datafusion/src/logical_plan/expr.rsindex f075aaa8f6..2c91136961 100644--- a/datafusion/src/logical_plan/expr.rs+++ b/datafusion/src/logical_plan/expr.rs@@ -144,14 +144,14 @@ pub fn combine_filters(filters: &[Expr]) -> Option<Expr> {////// For example, it rewrites:///-/// ```ignore+/// ```text/// .aggregate(vec![col("c1")], vec![sum(col("c2"))])?/// .project(vec![col("c1"), sum(col("c2"))?/// ```////// Into:///-/// ```ignore+/// ```text/// .aggregate(vec![col("c1")], vec![sum(col("c2"))])?/// .project(vec![col("c1"), col("SUM(#c2)")?/// ```diff --git a/datafusion/src/logical_plan/expr_rewriter.rs b/datafusion/src/logical_plan/expr_rewriter.rsindex 5062d5fce7..cee7c66f52 100644--- a/datafusion/src/logical_plan/expr_rewriter.rs+++ b/datafusion/src/logical_plan/expr_rewriter.rs@@ -32,7 +32,7 @@ use std::sync::Arc;pub enum RewriteRecursion {/// Continue rewrite / visit this expression.Continue,- /// Call [mutate()] immediately and return.+ /// Call [ExprRewriter::mutate()] immediately and return.Mutate,/// Do not rewrite / visit the children of this expression.Stop,@@ -339,13 +339,13 @@ fn rewrite_sort_col_by_aggs(expr: Expr, plan: &LogicalPlan) -> Result<Expr> {}}-/// Recursively call [`Column::normalize`] on all Column expressions+/// Recursively call [`Column::normalize_with_schemas`] on all Column expressions/// in the `expr` expression tree.pub fn normalize_col(expr: Expr, plan: &LogicalPlan) -> Result<Expr> {normalize_col_with_schemas(expr, &plan.all_schemas(), &plan.using_columns()?)}-/// Recursively call [`Column::normalize`] on all Column expressions+/// Recursively call [`Column::normalize_with_schemas`] on all Column expressions/// in the `expr` expression tree.fn normalize_col_with_schemas(expr: Expr,diff --git a/datafusion/src/optimizer/simplify_expressions.rs b/datafusion/src/optimizer/simplify_expressions.rsindex 4e9709bd9b..c049a47c2c 100644--- a/datafusion/src/optimizer/simplify_expressions.rs+++ b/datafusion/src/optimizer/simplify_expressions.rs@@ -272,7 +272,7 @@ pub struct ConstEvaluator<'a> {/// non evaluatable (e.g. had a column reference or volatile/// function)///- /// Specifically, can_evaluate[N] represents the state of+ /// Specifically, `can_evaluate[N]` represents the state of/// traversal when we are N levels deep in the tree, one entry for/// this Expr and each of its parents.///diff --git a/datafusion/src/physical_optimizer/pruning.rs b/datafusion/src/physical_optimizer/pruning.rsindex 7bbffd1546..00d9c0cb95 100644--- a/datafusion/src/physical_optimizer/pruning.rs+++ b/datafusion/src/physical_optimizer/pruning.rs@@ -25,7 +25,7 @@//! nothing in the row group can match.//!//! This code is currently specific to Parquet, but soon (TM), via-//! https://github.com/apache/arrow-datafusion/issues/363 it will+//! <https://github.com/apache/arrow-datafusion/issues/363> it will//! be genericized.use std::convert::TryFrom;@@ -47,7 +47,7 @@ use crate::{physical_plan::{ColumnarValue, PhysicalExpr},};-/// Interface to pass statistics information to [`PruningPredicates`]+/// Interface to pass statistics information to [`PruningPredicate`]////// Returns statistics for containers / files of data in Arrays.///@@ -88,7 +88,7 @@ pub trait PruningStatistics {/// Evaluates filter expressions on statistics in order to/// prune data containers (e.g. parquet row group)///-/// See [`try_new`] for more information.+/// See [`PruningPredicate::try_new`] for more information.#[derive(Debug, Clone)]pub struct PruningPredicate {/// The input schema against which the predicate will be evaluateddiff --git a/datafusion/src/physical_plan/hyperloglog/mod.rs b/datafusion/src/physical_plan/hyperloglog/mod.rsindex 3b91d3039e..3e28e29768 100644--- a/datafusion/src/physical_plan/hyperloglog/mod.rs+++ b/datafusion/src/physical_plan/hyperloglog/mod.rs@@ -20,7 +20,7 @@//! `hyperloglog` is a module that contains a modified version//! of [redis's implementation](https://github.com/redis/redis/blob/4930d19e70c391750479951022e207e19111eb55/src/hyperloglog.c)//! with some modification based on strong assumption of usage-//! within datafusion, so that [`approx_distinct`] function can+//! within datafusion, so that [`crate::logical_plan::approx_distinct`] function can//! be efficiently implemented.//!//! Specifically, like Redis's version, this HLL structure usesdiff --git a/datafusion/src/physical_plan/metrics/mod.rs b/datafusion/src/physical_plan/metrics/mod.rsindex 021f2df823..dbbb8af4f6 100644--- a/datafusion/src/physical_plan/metrics/mod.rs+++ b/datafusion/src/physical_plan/metrics/mod.rs@@ -40,7 +40,7 @@ pub use tracker::MemTrackingMetrics;pub use value::{Count, Gauge, MetricValue, ScopedTimerGuard, Time, Timestamp};/// Something that tracks a value of interest (metric) of a DataFusion-/// [`ExecutionPlan`] execution.+/// [`super::ExecutionPlan`] execution.////// Typically [`Metric`]s are not created directly, but instead/// are created using [`MetricBuilder`] or methods on@@ -319,7 +319,7 @@ impl Display for MetricsSet {/// A set of [`Metric`] for an individual "operator" (e.g. `&dyn/// ExecutionPlan`).///-/// This structure is intended as a convenience for [`ExecutionPlan`]+/// This structure is intended as a convenience for [`super::ExecutionPlan`]/// implementations so they can generate different streams for multiple/// partitions but easily report them together.///@@ -358,7 +358,7 @@ impl ExecutionPlanMetricsSet {/// "tags" in/// [InfluxDB](https://docs.influxdata.com/influxdb/v1.8/write_protocols/line_protocol_tutorial/)/// , "attributes" in [open-/// telemetry](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/datamodel.md],+/// telemetry]<https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/datamodel.md>,/// etc.////// As the name and value are expected to mostly be constant strings,diff --git a/datafusion/src/physical_plan/metrics/tracker.rs b/datafusion/src/physical_plan/metrics/tracker.rsindex bdceadb8a1..d8017b95ae 100644--- a/datafusion/src/physical_plan/metrics/tracker.rs+++ b/datafusion/src/physical_plan/metrics/tracker.rs@@ -102,7 +102,7 @@ impl MemTrackingMetrics {/// Record that some number of rows have been produced as output///- /// See the [`RecordOutput`] for conveniently recording record+ /// See the [`super::RecordOutput`] for conveniently recording record/// batch output for other thingpub fn record_output(&self, num_rows: usize) {self.metrics.record_output(num_rows)diff --git a/datafusion/src/physical_plan/metrics/value.rs b/datafusion/src/physical_plan/metrics/value.rsindex 43a0ad2365..ffb4ebb3f6 100644--- a/datafusion/src/physical_plan/metrics/value.rs+++ b/datafusion/src/physical_plan/metrics/value.rs@@ -312,7 +312,7 @@ impl<'a> Drop for ScopedTimerGuard<'a> {}}-/// Possible values for a [`Metric`].+/// Possible values for a [super::Metric].////// Among other differences, the metric types have different ways to/// logically interpret their underlying values and some metrics arediff --git a/datafusion/src/physical_plan/mod.rs b/datafusion/src/physical_plan/mod.rsindex 42fc217f24..cb9ae64408 100644--- a/datafusion/src/physical_plan/mod.rs+++ b/datafusion/src/physical_plan/mod.rs@@ -538,7 +538,7 @@ pub trait WindowExpr: Send + Sync + Debug {}/// expressions that are passed to the WindowAccumulator.- /// Functions which take a single input argument, such as `sum`, return a single [`Expr`],+ /// Functions which take a single input argument, such as `sum`, return a single [`datafusion_expr::expr::Expr`],/// others (e.g. `cov`) return many.fn expressions(&self) -> Vec<Arc<dyn PhysicalExpr>>;diff --git a/datafusion/src/physical_plan/tdigest/mod.rs b/datafusion/src/physical_plan/tdigest/mod.rsindex 603cfd867c..5bd8b9e35f 100644--- a/datafusion/src/physical_plan/tdigest/mod.rs+++ b/datafusion/src/physical_plan/tdigest/mod.rs@@ -17,7 +17,7 @@//! quantile calculations.//!//! The TDigest code in this module is modified from-//! https://github.com/MnO2/t-digest, itself a rust reimplementation of+//! <https://github.com/MnO2/t-digest>, itself a rust reimplementation of//! [Facebook's Folly TDigest] implementation.//!//! Alterations include reduction of runtime heap allocations, broader typediff --git a/datafusion/src/physical_plan/window_functions.rs b/datafusion/src/physical_plan/window_functions.rsindex b8cc96a504..b5445ae248 100644--- a/datafusion/src/physical_plan/window_functions.rs+++ b/datafusion/src/physical_plan/window_functions.rs@@ -18,7 +18,7 @@//! Window functions provide the ability to perform calculations across//! sets of rows that are related to the current query row.//!-//! see also https://www.postgresql.org/docs/current/functions-window.html+//! see also <https://www.postgresql.org/docs/current/functions-window.html>use crate::error::{DataFusionError, Result};use crate::physical_plan::functions::{TypeSignature, Volatility};diff --git a/datafusion/src/sql/planner.rs b/datafusion/src/sql/planner.rsindex 2e417c75f3..cbbea90d78 100644--- a/datafusion/src/sql/planner.rs+++ b/datafusion/src/sql/planner.rs@@ -698,7 +698,7 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {}/// Generate a logic plan from selection clause, the function contain optimization for cross join to inner join- /// Related PR: https://github.com/apache/arrow-datafusion/pull/1566+ /// Related PR: <https://github.com/apache/arrow-datafusion/pull/1566>fn plan_selection(&self,select: &Select,@@ -2084,11 +2084,11 @@ fn remove_join_expressions(/// Filters matching this pattern are added to `accum`/// Filters that don't match this pattern are added to `accum_filter`/// Examples:-///+/// ```text/// foo = bar => accum=[(foo, bar)] accum_filter=[]/// foo = bar AND bar = baz => accum=[(foo, bar), (bar, baz)] accum_filter=[]/// foo = bar AND baz > 1 => accum=[(foo, bar)] accum_filter=[baz > 1]-///+/// ```fn extract_join_keys(expr: &Expr,accum: &mut Vec<(Column, Column)>,