From 23d4513c4fde06f9c6f6f413c52681d9ee219935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Mantelet?= Date: Sat, 11 Nov 2023 00:20:37 +0100 Subject: [PATCH] RFC 2.1 semantics wg (#102) Add clarification about how to find unit for the 1st argument of `IN_UNIT` + add an two successful examples --- ADQL.tex | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ADQL.tex b/ADQL.tex index 71eee2c..4427d54 100644 --- a/ADQL.tex +++ b/ADQL.tex @@ -2757,11 +2757,21 @@ \subsubsection{IN\_UNIT} The \verb:IN_UNIT(): function returns the value of the first argument transformed into the unit defined by the second argument. -The first argument MUST be a numeric value expression. +The first argument MUST be a numeric value expression. If this argument is a +column name, the VOUnits for this column ought to be found in the metadata +attached to this column (e.g. \verb|TAP_SCHEMA.columns.unit| in a TAP service). The second argument MUST be a string literal containing a valid unit description using the formatting defined in the \VOUnitSpec{}. +Example: + +\begin{verbatim} + -- ra: column expressed in 'deg' + IN_UNIT(ra, 'rad') -- OK + IN_UNIT(ra, 'arcmin') -- OK +\end{verbatim} + It has to be noted that a unitless value, as defined by the \VOUnitSpec{}, can not be converted. Similarly a non-unitless value can not be converted into a unitless one.