Skip to content

Commit 87789c2

Browse files
sfc-gh-mslotclaude
andcommitted
Remove unused DeserializePartitionValueFromEpochInteger
No longer called after simplifying identity partition pushdown to use column values as-is instead of epoch integers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Marco Slot <marco.slot@snowflake.com>
1 parent 18a67bb commit 87789c2

3 files changed

Lines changed: 3 additions & 50 deletions

File tree

pg_lake_table/include/pg_lake/fdw/partition_transform.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ extern List *AllPartitionTransformList(Oid relationId);
3333
extern List *GetPartitionTransformsFromSpecFields(Oid relationId, List *specFields);
3434
extern void *DeserializePartitionValueFromPGText(IcebergPartitionTransform * transform,
3535
const char *valueText, size_t *valueLength);
36-
extern void *DeserializePartitionValueFromEpochInteger(IcebergPartitionTransform * transform,
37-
const char *epochText, size_t *valueLength);
3836
extern const char *SerializePartitionValueToPGText(void *value, size_t valueLength, IcebergPartitionTransform * transform);
3937
extern Datum PartitionValueToDatum(IcebergPartitionTransformType transformType, void *value, size_t valueLength,
4038
PGType pgType, bool *isNull);

pg_lake_table/src/fdw/partition_pushdown.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ NormalizeDuckDBTextToPGText(const char *duckdbText, Oid resultTypeOid,
201201

202202
getTypeInputInfo(resultTypeOid, &typoinput, &typioparam);
203203
Datum parsedDatum = OidInputFunctionCall(typoinput, (char *) duckdbText,
204-
typioparam, resultTypeMod);
204+
typioparam, resultTypeMod);
205205

206206
getTypeOutputInfo(resultTypeOid, &typoutput, &typIsVarlena);
207207
return OidOutputFunctionCall(typoutput, parsedDatum);
@@ -323,8 +323,8 @@ ParsePartitionValuesFromPartitionKeys(char *partitionKeysText, List *transforms)
323323
else
324324
{
325325
/*
326-
* Normalize DuckDB text to PG canonical format (e.g. "1.0" ->
327-
* "1" for numeric) so the roundtrip assertion in
326+
* Normalize DuckDB text to PG canonical format (e.g. "1.0" -> "1"
327+
* for numeric) so the roundtrip assertion in
328328
* DeserializePartitionValueFromPGText passes.
329329
*/
330330
char *normalizedText =

pg_lake_table/src/fdw/partition_transform.c

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,51 +1055,6 @@ DeserializePartitionValueFromPGText(IcebergPartitionTransform * transform,
10551055
return value;
10561056
}
10571057

1058-
/*
1059-
* DeserializePartitionValueFromEpochInteger converts an epoch integer text
1060-
* (from a DuckDB Hive-style partition path) to Iceberg binary format.
1061-
*
1062-
* For identity transforms on temporal types, the DuckDB expression produces
1063-
* epoch integers (days for date, microseconds for timestamp) instead of native
1064-
* text to avoid formatting issues with BC dates.
1065-
*/
1066-
void *
1067-
DeserializePartitionValueFromEpochInteger(IcebergPartitionTransform * transform,
1068-
const char *epochText, size_t *valueLength)
1069-
{
1070-
if (epochText == NULL)
1071-
{
1072-
*valueLength = 0;
1073-
return NULL;
1074-
}
1075-
1076-
Oid typeOid = transform->pgType.postgresTypeOid;
1077-
Datum valueDatum;
1078-
1079-
if (typeOid == DATEOID)
1080-
{
1081-
int32 epochDays = pg_strtoint32(epochText);
1082-
DateADT pgDate = AdjustDateFromUnixToPostgres(epochDays);
1083-
1084-
valueDatum = DateADTGetDatum(pgDate);
1085-
}
1086-
else if (typeOid == TIMESTAMPOID || typeOid == TIMESTAMPTZOID)
1087-
{
1088-
int64 epochMicros = pg_strtoint64(epochText);
1089-
Timestamp pgTs = AdjustTimestampFromUnixToPostgres(epochMicros);
1090-
1091-
valueDatum = TimestampGetDatum(pgTs);
1092-
}
1093-
else
1094-
{
1095-
ereport(ERROR,
1096-
(errcode(ERRCODE_INTERNAL_ERROR),
1097-
errmsg("DeserializePartitionValueFromEpochInteger called for non-temporal type %u",
1098-
typeOid)));
1099-
}
1100-
1101-
return DatumToPartitionValue(transform, valueDatum, false, valueLength);
1102-
}
11031058

11041059

11051060
/*

0 commit comments

Comments
 (0)