Skip to content

Commit a63ef45

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 d20b6d1 commit a63ef45

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
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,
@@ -516,7 +516,7 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
516516
})
517517
}
518518

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

datafusion/sql/src/statement.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ fn ident_to_string(ident: &Ident) -> String {
7171
normalize_ident(ident.to_owned())
7272
}
7373

74-
fn object_name_to_string(object_name: &ObjectName) -> String {
74+
pub fn object_name_to_string(object_name: &ObjectName) -> String {
7575
object_name
7676
.0
7777
.iter()
@@ -94,7 +94,9 @@ fn get_schema_name(schema_name: &SchemaName) -> String {
9494

9595
/// Construct `TableConstraint`(s) for the given columns by iterating over
9696
/// `columns` and extracting individual inline constraint definitions.
97-
fn calc_inline_constraints_from_columns(columns: &[ColumnDef]) -> Vec<TableConstraint> {
97+
pub fn calc_inline_constraints_from_columns(
98+
columns: &[ColumnDef],
99+
) -> Vec<TableConstraint> {
98100
let mut constraints = vec![];
99101
for column in columns {
100102
for ast::ColumnOptionDef { name, option } in &column.options {
@@ -1484,7 +1486,7 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
14841486
}
14851487

14861488
/// Convert each [TableConstraint] to corresponding [Constraint]
1487-
fn new_constraint_from_table_constraints(
1489+
pub fn new_constraint_from_table_constraints(
14881490
&self,
14891491
constraints: &[TableConstraint],
14901492
df_schema: &DFSchemaRef,
@@ -2160,7 +2162,7 @@ ON p.function_name = r.routine_name
21602162
}
21612163

21622164
/// Return true if there is a table provider available for "schema.table"
2163-
fn has_table(&self, schema: &str, table: &str) -> bool {
2165+
pub fn has_table(&self, schema: &str, table: &str) -> bool {
21642166
let tables_reference = TableReference::Partial {
21652167
schema: schema.into(),
21662168
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)