zentol closed pull request #7306: [hotfix][docs][udfs.md]fix the example of
user-defined function in udfs.md
URL: https://github.com/apache/flink/pull/7306
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/docs/dev/table/udfs.md b/docs/dev/table/udfs.md
index 20bf49d5999..f2f6b7bcedd 100644
--- a/docs/dev/table/udfs.md
+++ b/docs/dev/table/udfs.md
@@ -72,7 +72,7 @@ tableEnv.registerFunction("hashCode", new HashCode(10));
myTable.select("string, string.hashCode(), hashCode(string)");
// use the function in SQL API
-tableEnv.sqlQuery("SELECT string, HASHCODE(string) FROM MyTable");
+tableEnv.sqlQuery("SELECT string, hashCode(string) FROM MyTable");
{% endhighlight %}
</div>
@@ -93,7 +93,7 @@ myTable.select('string, hashCode('string))
// register and use the function in SQL
tableEnv.registerFunction("hashCode", new HashCode(10))
-tableEnv.sqlQuery("SELECT string, HASHCODE(string) FROM MyTable")
+tableEnv.sqlQuery("SELECT string, hashCode(string) FROM MyTable")
{% endhighlight %}
</div>
</div>
@@ -110,8 +110,8 @@ public static class TimestampModifier extends
ScalarFunction {
return t % 1000;
}
- public TypeInformation<?> getResultType(signature: Class<?>[]) {
- return Types.TIMESTAMP;
+ public TypeInformation<?> getResultType(Class<?>[] signature) {
+ return Types.SQL_TIMESTAMP;
}
}
{% endhighlight %}
@@ -230,7 +230,7 @@ public class CustomTypeSplit extends TableFunction<Row> {
for (String s : str.split(" ")) {
Row row = new Row(2);
row.setField(0, s);
- row.setField(1, s.length);
+ row.setField(1, s.length());
collect(row);
}
}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services