ADQL DISTANCE argument?

Markus Demleitner msdemlei at ari.uni-heidelberg.de
Mon Feb 24 10:33:44 CET 2020


Hi Ger,

On Fri, Feb 21, 2020 at 06:51:03PM +0100, Ger van Diepen wrote:
> Why not support a distance between a POINT and 2 coordinates (and
> vice versa) which can be nice if the POINT is a column?
> Basically, supporting 4 coords is syntactical sugar, so it is
> logical (IMHO) to support distance between POINT and 2 coords as
> well.

Hm -- I'd say it's a matter of degree.  The syntactic sugar of
letting in four stand-alone columns was let in because it's *by far*
(I'd estimate > 95%) the most common case at the moment.  But I'd
always prefer to err on the side of having too little syntactic sugar
-- every grain adds bug surface, and that in an area where current
systems make it tricky to write queries that use indices anyway.

In this particular case there's the additional complication that
without type inference (that can sometimes be hard in practice) the
morpher wouldn't know which of the arguments is the point and which
is the coordinates, so it would be quite a bit of bug surface.
Let's not do it.

> I assume distance is the angular distance (along a great circle),
> thus not a straight line :-) But it does not say so.

Ah, fortunately it does, in the DISTANCE section:

  The DISTANCE function computes the arc length along a great circle
  between two points and returns a numeric value expression in degrees.

(in git commit 062652800e6f6a7ab5e9fe6c4f9f11c1344e5a9b).

Phewy...

          -- Markus


More information about the dal mailing list