Skip to content

Commit

Permalink
[MINOR][SQL] Fix the typo in function names: crete
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?
Fix the typo: crete -> create.

### Why are the changes needed?
To improve code maintenance. Find the functions by names should be easer after the changes.

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
By compiling and running related test suites:
```
$ build/sbt "test:testOnly *ParquetRebaseDatetimeV2Suite"
$ build/sbt "test:testOnly *AvroV1Suite"
```

Closes apache#34978 from MaxGekk/fix-typo-crete.

Authored-by: Max Gekk <max.gekk@gmail.com>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
  • Loading branch information
MaxGekk authored and HyukjinKwon committed Dec 22, 2021
1 parent 1eb5b88 commit 72c278a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ private[sql] class AvroDeserializer(

private lazy val decimalConversions = new DecimalConversion()

private val dateRebaseFunc = DataSourceUtils.creteDateRebaseFuncInRead(
private val dateRebaseFunc = DataSourceUtils.createDateRebaseFuncInRead(
datetimeRebaseMode, "Avro")

private val timestampRebaseFunc = DataSourceUtils.creteTimestampRebaseFuncInRead(
private val timestampRebaseFunc = DataSourceUtils.createTimestampRebaseFuncInRead(
datetimeRebaseMode, "Avro")

private val converter: Any => Option[Any] = try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ private[sql] class AvroSerializer(
converter.apply(catalystData)
}

private val dateRebaseFunc = DataSourceUtils.creteDateRebaseFuncInWrite(
private val dateRebaseFunc = DataSourceUtils.createDateRebaseFuncInWrite(
datetimeRebaseMode, "Avro")

private val timestampRebaseFunc = DataSourceUtils.creteTimestampRebaseFuncInWrite(
private val timestampRebaseFunc = DataSourceUtils.createTimestampRebaseFuncInWrite(
datetimeRebaseMode, "Avro")

private val converter: Any => Any = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ object DataSourceUtils extends PredicateHelper {
QueryExecutionErrors.sparkUpgradeInWritingDatesError(format, config)
}

def creteDateRebaseFuncInRead(
def createDateRebaseFuncInRead(
rebaseMode: LegacyBehaviorPolicy.Value,
format: String): Int => Int = rebaseMode match {
case LegacyBehaviorPolicy.EXCEPTION => days: Int =>
Expand All @@ -184,7 +184,7 @@ object DataSourceUtils extends PredicateHelper {
case LegacyBehaviorPolicy.CORRECTED => identity[Int]
}

def creteDateRebaseFuncInWrite(
def createDateRebaseFuncInWrite(
rebaseMode: LegacyBehaviorPolicy.Value,
format: String): Int => Int = rebaseMode match {
case LegacyBehaviorPolicy.EXCEPTION => days: Int =>
Expand All @@ -196,7 +196,7 @@ object DataSourceUtils extends PredicateHelper {
case LegacyBehaviorPolicy.CORRECTED => identity[Int]
}

def creteTimestampRebaseFuncInRead(
def createTimestampRebaseFuncInRead(
rebaseMode: LegacyBehaviorPolicy.Value,
format: String): Long => Long = rebaseMode match {
case LegacyBehaviorPolicy.EXCEPTION => micros: Long =>
Expand All @@ -208,7 +208,7 @@ object DataSourceUtils extends PredicateHelper {
case LegacyBehaviorPolicy.CORRECTED => identity[Long]
}

def creteTimestampRebaseFuncInWrite(
def createTimestampRebaseFuncInWrite(
rebaseMode: LegacyBehaviorPolicy.Value,
format: String): Long => Long = rebaseMode match {
case LegacyBehaviorPolicy.EXCEPTION => micros: Long =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,13 @@ private[parquet] class ParquetRowConverter(
*/
def currentRecord: InternalRow = currentRow

private val dateRebaseFunc = DataSourceUtils.creteDateRebaseFuncInRead(
private val dateRebaseFunc = DataSourceUtils.createDateRebaseFuncInRead(
datetimeRebaseMode, "Parquet")

private val timestampRebaseFunc = DataSourceUtils.creteTimestampRebaseFuncInRead(
private val timestampRebaseFunc = DataSourceUtils.createTimestampRebaseFuncInRead(
datetimeRebaseMode, "Parquet")

private val int96RebaseFunc = DataSourceUtils.creteTimestampRebaseFuncInRead(
private val int96RebaseFunc = DataSourceUtils.createTimestampRebaseFuncInRead(
int96RebaseMode, "Parquet INT96")

// Converters for each field.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,16 @@ class ParquetWriteSupport extends WriteSupport[InternalRow] with Logging {
private val datetimeRebaseMode = LegacyBehaviorPolicy.withName(
SQLConf.get.getConf(SQLConf.PARQUET_REBASE_MODE_IN_WRITE))

private val dateRebaseFunc = DataSourceUtils.creteDateRebaseFuncInWrite(
private val dateRebaseFunc = DataSourceUtils.createDateRebaseFuncInWrite(
datetimeRebaseMode, "Parquet")

private val timestampRebaseFunc = DataSourceUtils.creteTimestampRebaseFuncInWrite(
private val timestampRebaseFunc = DataSourceUtils.createTimestampRebaseFuncInWrite(
datetimeRebaseMode, "Parquet")

private val int96RebaseMode = LegacyBehaviorPolicy.withName(
SQLConf.get.getConf(SQLConf.PARQUET_INT96_REBASE_MODE_IN_WRITE))

private val int96RebaseFunc = DataSourceUtils.creteTimestampRebaseFuncInWrite(
private val int96RebaseFunc = DataSourceUtils.createTimestampRebaseFuncInWrite(
int96RebaseMode, "Parquet INT96")

override def init(configuration: Configuration): WriteContext = {
Expand Down

0 comments on commit 72c278a

Please sign in to comment.