Skip to content

Commit 665361d

Browse files
committed
Fix Scala example
1 parent e06eb60 commit 665361d

File tree

1 file changed

+4
-3
lines changed
  • docs/content/docs/dev/table/functions

1 file changed

+4
-3
lines changed

docs/content/docs/dev/table/functions/udfs.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,8 +1261,9 @@ env.sqlQuery("SELECT * FROM MyTable, LATERAL TABLE(BackgroundFunction(myField))"
12611261
{{< tab "Scala" >}}
12621262
```scala
12631263
import org.apache.flink.table.api._
1264-
import org.apache.flink.table.functions.{AsyncScalarFunction, FunctionContext}
1264+
import org.apache.flink.table.functions.{AsyncTableFunction, FunctionContext}
12651265

1266+
import java.util
12661267
import java.util.Random
12671268
import java.util.concurrent.{CompletableFuture, Executor, Executors}
12681269

@@ -1274,9 +1275,9 @@ class BackgroundFunc extends AsyncTableFunction[java.lang.Long] {
12741275
executor = Executors.newFixedThreadPool(10)
12751276
}
12761277

1277-
def eval(future: CompletableFuture[java.util.Collection[java.lang.Long], waitMax: Integer): Unit = {
1278+
def eval(future: CompletableFuture[java.util.Collection[java.lang.Long]], waitMax: Integer): Unit = {
12781279
executor.execute(() => {
1279-
ArrayList<Long> result = new ArrayList<>();
1280+
val result = new util.ArrayList[java.lang.Long]()
12801281
val sleepTime = new Random().nextInt(waitMax)
12811282
try Thread.sleep(sleepTime)
12821283
catch {

0 commit comments

Comments
 (0)