File tree 2 files changed +10
-10
lines changed
content/docs/dev/table/functions
content.zh/docs/dev/table/functions
2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -410,19 +410,19 @@ class OverloadedFunction extends ScalarFunction {
410
410
411
411
// 定义 decimal 的精度和小数位
412
412
@ DataTypeHint (" DECIMAL(12, 3)" )
413
- def eval (double a, double b ): BigDecimal = {
414
- java.lang. BigDecimal .valueOf (a + b)
413
+ def eval (a : Double , b : Double ): BigDecimal = {
414
+ BigDecimal (a + b)
415
415
}
416
416
417
417
// 定义嵌套数据类型
418
418
@ DataTypeHint (" ROW<s STRING, t TIMESTAMP_LTZ(3)>" )
419
- def eval (Int i ): Row = {
420
- Row .of(java.lang. String .valueOf(i) , java.time.Instant .ofEpochSecond(i))
419
+ def eval (i : Int ): Row = {
420
+ Row .of(i.toString , java.time.Instant .ofEpochSecond(i))
421
421
}
422
422
423
423
// 允许任意类型的符入,并输出定制序列化后的值
424
424
@ DataTypeHint (value = " RAW" , bridgedTo = classOf [java.nio.ByteBuffer ])
425
- def eval (@ DataTypeHint (inputGroup = InputGroup .ANY ) Object o ): java.nio.ByteBuffer = {
425
+ def eval (@ DataTypeHint (inputGroup = InputGroup .ANY ) o : Any ): java.nio.ByteBuffer = {
426
426
MyUtils .serializeToByteBuffer(o)
427
427
}
428
428
}
Original file line number Diff line number Diff line change @@ -415,19 +415,19 @@ class OverloadedFunction extends ScalarFunction {
415
415
416
416
// define the precision and scale of a decimal
417
417
@ DataTypeHint (" DECIMAL(12, 3)" )
418
- def eval (double a, double b ): BigDecimal = {
419
- java.lang. BigDecimal .valueOf (a + b)
418
+ def eval (a : Double , b : Double ): BigDecimal = {
419
+ BigDecimal (a + b)
420
420
}
421
421
422
422
// define a nested data type
423
423
@ DataTypeHint (" ROW<s STRING, t TIMESTAMP_LTZ(3)>" )
424
- def eval (Int i ): Row = {
425
- Row .of(java.lang. String .valueOf(i) , java.time.Instant .ofEpochSecond(i))
424
+ def eval (i : Int ): Row = {
425
+ Row .of(i.toString , java.time.Instant .ofEpochSecond(i))
426
426
}
427
427
428
428
// allow wildcard input and customly serialized output
429
429
@ DataTypeHint (value = " RAW" , bridgedTo = classOf [java.nio.ByteBuffer ])
430
- def eval (@ DataTypeHint (inputGroup = InputGroup .ANY ) Object o ): java.nio.ByteBuffer = {
430
+ def eval (@ DataTypeHint (inputGroup = InputGroup .ANY ) o : Any ): java.nio.ByteBuffer = {
431
431
MyUtils .serializeToByteBuffer(o)
432
432
}
433
433
}
You can’t perform that action at this time.
0 commit comments