Skip to content

Commit 55d2af2

Browse files
committed
Renamings to match up repeat_row's internal name to SQL name
1 parent dc59664 commit 55d2af2

3 files changed

Lines changed: 16 additions & 16 deletions

File tree

src/expr/src/relation/func.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3280,7 +3280,7 @@ pub fn csv_extract(a: Datum<'_>, n_cols: usize) -> impl Iterator<Item = (Row, Di
32803280
})
32813281
}
32823282

3283-
pub fn repeat(a: Datum) -> Option<(Row, Diff)> {
3283+
pub fn repeat_row(a: Datum) -> Option<(Row, Diff)> {
32843284
let n = a.unwrap_int64();
32853285
if n != 0 {
32863286
Some((Row::default(), n.into()))
@@ -3396,7 +3396,7 @@ pub enum TableFunc {
33963396
GuardSubquerySize {
33973397
column_type: SqlScalarType,
33983398
},
3399-
Repeat,
3399+
RepeatRow,
34003400
UnnestArray {
34013401
el_typ: SqlScalarType,
34023402
},
@@ -3471,7 +3471,7 @@ impl TableFunc {
34713471
| TableFunc::GenerateSeriesTimestamp
34723472
| TableFunc::GenerateSeriesTimestampTz
34733473
| TableFunc::GuardSubquerySize { .. }
3474-
| TableFunc::Repeat
3474+
| TableFunc::RepeatRow
34753475
| TableFunc::UnnestArray { .. }
34763476
| TableFunc::UnnestList { .. }
34773477
| TableFunc::UnnestMap { .. }
@@ -3566,7 +3566,7 @@ impl TableFunc {
35663566
Ok(Box::new([].into_iter()))
35673567
}
35683568
}
3569-
TableFunc::Repeat => Ok(Box::new(repeat(datums[0]).into_iter())),
3569+
TableFunc::RepeatRow => Ok(Box::new(repeat_row(datums[0]).into_iter())),
35703570
TableFunc::UnnestArray { .. } => Ok(Box::new(unnest_array(datums[0]))),
35713571
TableFunc::UnnestList { .. } => Ok(Box::new(unnest_list(datums[0]))),
35723572
TableFunc::UnnestMap { .. } => Ok(Box::new(unnest_map(datums[0]))),
@@ -3682,7 +3682,7 @@ impl TableFunc {
36823682
let keys = vec![];
36833683
(column_types, keys)
36843684
}
3685-
TableFunc::Repeat => {
3685+
TableFunc::RepeatRow => {
36863686
let column_types = vec![];
36873687
let keys = vec![];
36883688
(column_types, keys)
@@ -3763,7 +3763,7 @@ impl TableFunc {
37633763
TableFunc::GenerateSeriesTimestampTz => 1,
37643764
TableFunc::GenerateSubscriptsArray => 1,
37653765
TableFunc::GuardSubquerySize { .. } => 1,
3766-
TableFunc::Repeat => 0,
3766+
TableFunc::RepeatRow => 0,
37673767
TableFunc::UnnestArray { .. } => 1,
37683768
TableFunc::UnnestList { .. } => 1,
37693769
TableFunc::UnnestMap { .. } => 2,
@@ -3790,7 +3790,7 @@ impl TableFunc {
37903790
| TableFunc::GenerateSubscriptsArray
37913791
| TableFunc::RegexpExtract(_)
37923792
| TableFunc::CsvExtract(_)
3793-
| TableFunc::Repeat
3793+
| TableFunc::RepeatRow
37943794
| TableFunc::UnnestArray { .. }
37953795
| TableFunc::UnnestList { .. }
37963796
| TableFunc::UnnestMap { .. }
@@ -3821,7 +3821,7 @@ impl TableFunc {
38213821
TableFunc::GenerateSeriesTimestamp => true,
38223822
TableFunc::GenerateSeriesTimestampTz => true,
38233823
TableFunc::GenerateSubscriptsArray => true,
3824-
TableFunc::Repeat => false,
3824+
TableFunc::RepeatRow => false,
38253825
TableFunc::UnnestArray { .. } => true,
38263826
TableFunc::UnnestList { .. } => true,
38273827
TableFunc::UnnestMap { .. } => true,
@@ -3852,7 +3852,7 @@ impl fmt::Display for TableFunc {
38523852
TableFunc::GenerateSeriesTimestampTz => f.write_str("generate_series"),
38533853
TableFunc::GenerateSubscriptsArray => f.write_str("generate_subscripts"),
38543854
TableFunc::GuardSubquerySize { .. } => f.write_str("guard_subquery_size"),
3855-
TableFunc::Repeat => f.write_str("repeat_row"),
3855+
TableFunc::RepeatRow => f.write_str("repeat_row"),
38563856
TableFunc::UnnestArray { .. } => f.write_str("unnest_array"),
38573857
TableFunc::UnnestList { .. } => f.write_str("unnest_list"),
38583858
TableFunc::UnnestMap { .. } => f.write_str("unnest_map"),

src/pgrepr-consts/src/oid.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ pub const FUNC_MZ_LOGICAL_TIMESTAMP_OID: u32 = 16_409;
139139
pub const FUNC_MZ_RENDER_TYPMOD_OID: u32 = 16_410;
140140
pub const FUNC_MZ_VERSION_OID: u32 = 16_411;
141141
pub const FUNC_REGEXP_EXTRACT_OID: u32 = 16_412;
142-
pub const FUNC_REPEAT_OID: u32 = 16_413;
142+
pub const FUNC_REPEAT_ROW_OID: u32 = 16_413;
143143
pub const FUNC_ROUND_F32_OID: u32 = 16_414;
144144
pub const FUNC_UNNEST_LIST_OID: u32 = 16_416;
145145
pub const OP_CONCAT_ELEMENY_LIST_OID: u32 = 16_417;

src/sql/src/func.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4566,7 +4566,7 @@ pub static MZ_CATALOG_BUILTINS: LazyLock<BTreeMap<&'static str, Func>> = LazyLoc
45664566
},
45674567
"list_n_layers" => Scalar {
45684568
vec![ListAny] => Operation::unary(|ecx, e| {
4569-
ecx.require_feature_flag(&crate::session::vars::ENABLE_LIST_N_LAYERS)?;
4569+
ecx.require_feature_flag(&vars::ENABLE_LIST_N_LAYERS)?;
45704570
let d = ecx.scalar_type(&e).unwrap_list_n_layers();
45714571
match i32::try_from(d) {
45724572
Ok(d) => Ok(HirScalarExpr::literal(Datum::Int32(d), SqlScalarType::Int32)),
@@ -4581,7 +4581,7 @@ pub static MZ_CATALOG_BUILTINS: LazyLock<BTreeMap<&'static str, Func>> = LazyLoc
45814581
},
45824582
"list_length_max" => Scalar {
45834583
vec![ListAny, Plain(SqlScalarType::Int64)] => Operation::binary(|ecx, lhs, rhs| {
4584-
ecx.require_feature_flag(&crate::session::vars::ENABLE_LIST_LENGTH_MAX)?;
4584+
ecx.require_feature_flag(&vars::ENABLE_LIST_LENGTH_MAX)?;
45854585
let max_layer = ecx.scalar_type(&lhs).unwrap_list_n_layers();
45864586
Ok(lhs.call_binary(rhs, BinaryFunc::from(func::ListLengthMax { max_layer })))
45874587
}) => Int32, oid::FUNC_LIST_LENGTH_MAX_OID;
@@ -4593,7 +4593,7 @@ pub static MZ_CATALOG_BUILTINS: LazyLock<BTreeMap<&'static str, Func>> = LazyLoc
45934593
},
45944594
"list_remove" => Scalar {
45954595
vec![ListAnyCompatible, ListElementAnyCompatible] => Operation::binary(|ecx, lhs, rhs| {
4596-
ecx.require_feature_flag(&crate::session::vars::ENABLE_LIST_REMOVE)?;
4596+
ecx.require_feature_flag(&vars::ENABLE_LIST_REMOVE)?;
45974597
Ok(lhs.call_binary(rhs, func::ListRemove))
45984598
}) => ListAnyCompatible, oid::FUNC_LIST_REMOVE_OID;
45994599
},
@@ -4735,15 +4735,15 @@ pub static MZ_CATALOG_BUILTINS: LazyLock<BTreeMap<&'static str, Func>> = LazyLoc
47354735
},
47364736
"repeat_row" => Table {
47374737
params!(Int64) => Operation::unary(move |ecx, n| {
4738-
ecx.require_feature_flag(&crate::session::vars::ENABLE_REPEAT_ROW)?;
4738+
ecx.require_feature_flag(&vars::ENABLE_REPEAT_ROW)?;
47394739
Ok(TableFuncPlan {
47404740
imp: TableFuncImpl::CallTable {
4741-
func: TableFunc::Repeat,
4741+
func: TableFunc::RepeatRow,
47424742
exprs: vec![n],
47434743
},
47444744
column_names: vec![]
47454745
})
4746-
}) => ReturnType::none(true), oid::FUNC_REPEAT_OID;
4746+
}) => ReturnType::none(true), oid::FUNC_REPEAT_ROW_OID;
47474747
},
47484748
"seahash" => Scalar {
47494749
params!(String) => UnaryFunc::SeahashString(func::SeahashString)

0 commit comments

Comments
 (0)