Skip to content

Commit d2bcb61

Browse files
osipovartemDenys Tsomenko
authored andcommitted
Make required funcs public (#1)
* Make required funcs public * Make required funcs public * Make required funcs public
1 parent 03fa3b9 commit d2bcb61

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

datafusion/sql/src/planner.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
382382
}
383383

384384
/// Returns a vector of (column_name, default_expr) pairs
385-
pub(super) fn build_column_defaults(
385+
pub fn build_column_defaults(
386386
&self,
387387
columns: &Vec<SQLColumnDef>,
388388
planner_context: &mut PlannerContext,
@@ -517,7 +517,7 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
517517
})
518518
}
519519

520-
pub(crate) fn convert_data_type(&self, sql_type: &SQLDataType) -> Result<DataType> {
520+
pub fn convert_data_type(&self, sql_type: &SQLDataType) -> Result<DataType> {
521521
// First check if any of the registered type_planner can handle this type
522522
if let Some(type_planner) = self.context_provider.get_type_planner() {
523523
if let Some(data_type) = type_planner.plan_type(sql_type)? {

datafusion/sql/src/statement.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ fn ident_to_string(ident: &Ident) -> String {
7272
normalize_ident(ident.to_owned())
7373
}
7474

75-
fn object_name_to_string(object_name: &ObjectName) -> String {
75+
pub fn object_name_to_string(object_name: &ObjectName) -> String {
7676
object_name
7777
.0
7878
.iter()
@@ -101,7 +101,9 @@ fn get_schema_name(schema_name: &SchemaName) -> String {
101101

102102
/// Construct `TableConstraint`(s) for the given columns by iterating over
103103
/// `columns` and extracting individual inline constraint definitions.
104-
fn calc_inline_constraints_from_columns(columns: &[ColumnDef]) -> Vec<TableConstraint> {
104+
pub fn calc_inline_constraints_from_columns(
105+
columns: &[ColumnDef],
106+
) -> Vec<TableConstraint> {
105107
let mut constraints = vec![];
106108
for column in columns {
107109
for ast::ColumnOptionDef { name, option } in &column.options {
@@ -2225,7 +2227,7 @@ ON p.function_name = r.routine_name
22252227
}
22262228

22272229
/// Return true if there is a table provider available for "schema.table"
2228-
fn has_table(&self, schema: &str, table: &str) -> bool {
2230+
pub fn has_table(&self, schema: &str, table: &str) -> bool {
22292231
let tables_reference = TableReference::Partial {
22302232
schema: schema.into(),
22312233
table: table.into(),

datafusion/sql/src/utils.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,7 @@ pub fn window_expr_common_partition_keys(window_exprs: &[Expr]) -> Result<&[Expr
267267

268268
/// Returns a validated `DataType` for the specified precision and
269269
/// scale
270-
pub(crate) fn make_decimal_type(
271-
precision: Option<u64>,
272-
scale: Option<u64>,
273-
) -> Result<DataType> {
270+
pub fn make_decimal_type(precision: Option<u64>, scale: Option<u64>) -> Result<DataType> {
274271
// postgres like behavior
275272
let (precision, scale) = match (precision, scale) {
276273
(Some(p), Some(s)) => (p as u8, s as i8),
@@ -298,7 +295,7 @@ pub(crate) fn make_decimal_type(
298295
}
299296

300297
/// Normalize an owned identifier to a lowercase string, unless the identifier is quoted.
301-
pub(crate) fn normalize_ident(id: Ident) -> String {
298+
pub fn normalize_ident(id: Ident) -> String {
302299
match id.quote_style {
303300
Some(_) => id.value,
304301
None => id.value.to_ascii_lowercase(),

0 commit comments

Comments
 (0)