Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions datafusion/sql/src/planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
}

/// Returns a vector of (column_name, default_expr) pairs
pub(super) fn build_column_defaults(
pub fn build_column_defaults(
&self,
columns: &Vec<SQLColumnDef>,
planner_context: &mut PlannerContext,
Expand Down Expand Up @@ -372,7 +372,7 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
})
}

pub(crate) fn convert_data_type(&self, sql_type: &SQLDataType) -> Result<DataType> {
pub fn convert_data_type(&self, sql_type: &SQLDataType) -> Result<DataType> {
// First check if any of the registered type_planner can handle this type
if let Some(type_planner) = self.context_provider.get_type_planner() {
if let Some(data_type) = type_planner.plan_type(sql_type)? {
Expand Down Expand Up @@ -566,7 +566,7 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
| SQLDataType::MediumText
| SQLDataType::LongText
| SQLDataType::Bit(_)
|SQLDataType::BitVarying(_)
| SQLDataType::BitVarying(_)
=> not_impl_err!(
"Unsupported SQL type {sql_type:?}"
),
Expand Down
10 changes: 6 additions & 4 deletions datafusion/sql/src/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ fn ident_to_string(ident: &Ident) -> String {
normalize_ident(ident.to_owned())
}

fn object_name_to_string(object_name: &ObjectName) -> String {
pub fn object_name_to_string(object_name: &ObjectName) -> String {
object_name
.0
.iter()
Expand All @@ -94,7 +94,9 @@ fn get_schema_name(schema_name: &SchemaName) -> String {

/// Construct `TableConstraint`(s) for the given columns by iterating over
/// `columns` and extracting individual inline constraint definitions.
fn calc_inline_constraints_from_columns(columns: &[ColumnDef]) -> Vec<TableConstraint> {
pub fn calc_inline_constraints_from_columns(
columns: &[ColumnDef],
) -> Vec<TableConstraint> {
let mut constraints = vec![];
for column in columns {
for ast::ColumnOptionDef { name, option } in &column.options {
Expand Down Expand Up @@ -1418,7 +1420,7 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
}

/// Convert each [TableConstraint] to corresponding [Constraint]
fn new_constraint_from_table_constraints(
pub fn new_constraint_from_table_constraints(
constraints: &[TableConstraint],
df_schema: &DFSchemaRef,
) -> Result<Constraints> {
Expand Down Expand Up @@ -2097,7 +2099,7 @@ ON p.function_name = r.routine_name
}

/// Return true if there is a table provider available for "schema.table"
fn has_table(&self, schema: &str, table: &str) -> bool {
pub fn has_table(&self, schema: &str, table: &str) -> bool {
let tables_reference = TableReference::Partial {
schema: schema.into(),
table: table.into(),
Expand Down
7 changes: 2 additions & 5 deletions datafusion/sql/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,7 @@ pub fn window_expr_common_partition_keys(window_exprs: &[Expr]) -> Result<&[Expr

/// Returns a validated `DataType` for the specified precision and
/// scale
pub(crate) fn make_decimal_type(
precision: Option<u64>,
scale: Option<u64>,
) -> Result<DataType> {
pub fn make_decimal_type(precision: Option<u64>, scale: Option<u64>) -> Result<DataType> {
// postgres like behavior
let (precision, scale) = match (precision, scale) {
(Some(p), Some(s)) => (p as u8, s as i8),
Expand Down Expand Up @@ -261,7 +258,7 @@ pub(crate) fn make_decimal_type(
}

/// Normalize an owned identifier to a lowercase string, unless the identifier is quoted.
pub(crate) fn normalize_ident(id: Ident) -> String {
pub fn normalize_ident(id: Ident) -> String {
match id.quote_style {
Some(_) => id.value,
None => id.value.to_ascii_lowercase(),
Expand Down
Loading