wudi 6 months ago
commit
72b71ac662
2 changed files with 36 additions and 0 deletions
  1. 26 0
      pom.xml
  2. 10 0
      src/main/java/com/moka/udf/ConvInt32.java

+ 26 - 0
pom.xml

@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.aliyun.odps.myJava</groupId>
+    <artifactId>int-conv-32</artifactId>
+    <version>1.0-SNAPSHOT</version>
+
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.aliyun.odps</groupId>
+            <artifactId>odps-sdk-udf</artifactId>
+            <version>0.29.10-public</version>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+
+</project>

+ 10 - 0
src/main/java/com/moka/udf/ConvInt32.java

@@ -0,0 +1,10 @@
+package com.moka.udf;
+
+import com.aliyun.odps.udf.UDF;
+
+public class ConvInt32 extends UDF {
+    // TODO define parameters and return type, e.g:  public String evaluate(String a, String b)
+    public String evaluate(Integer s) {
+        return s.toString(36);
+    }
+}