raminqaf commented on code in PR #30185: URL: https://github.com/apache/flink/pull/30185#discussion_r4771549449
########## docs/data/functions/mathematical/arithmetic_operators.yml: ########## @@ -0,0 +1,156 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License + +name: Arithmetic operators +summary: Returns the sum, difference, product, quotient or negation of numbers, with `+`, `-`, `*` and `/`. + +syntax: + sql: | + +expr + -expr + expr1 + expr2 + expr1 - expr2 + expr1 * expr2 + expr1 / expr2 + java: | + negative($("expr")) + $("expr1").plus(expr2) + $("expr1").minus(expr2) + $("expr1").times(expr2) + $("expr1").dividedBy(expr2) + python: | + -col("expr") + col("expr1") + expr2 + col("expr1") - expr2 + col("expr1") * expr2 + col("expr1") / expr2 + +arguments: + - name: expr, expr1, expr2 + type: Any numeric type + required: true + +returns: + description: The sum, difference, product or quotient of `expr1` and `expr2`. Unary `-` flips the sign of `expr`, and unary `+` returns it unchanged. A division of two integers drops the fraction, toward zero. + nulls: Returns NULL if an operand is NULL, and for a `DECIMAL` result that needs more than 38 digits. With NOT NULL operands, that result fails the job instead. + type: Two integer types give the larger of the two. An integer with a `FLOAT` or `DOUBLE` gives that type, and with a `DECIMAL` a `DECIMAL`. A `DECIMAL` with a `FLOAT` or `DOUBLE` gives `DOUBLE`. A `DOUBLE` with a `FLOAT` gives `DOUBLE`, but a `FLOAT` with a `DOUBLE` gives `FLOAT` instead of `DOUBLE`. Unary `+` and `-` keep the type of `expr`. NOT NULL if every operand is NOT NULL. Review Comment: Added "In SQL" -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
