You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@asterixdb.apache.org by Preston Carman <pr...@apache.org> on 2017/05/14 17:00:45 UTC
ASTERIXDB-1371: Geo data type format question
I have question about the format used by AsterixDB to store points,
lines, etc.[1]. As we are adding support for other formats [2], I
wanted to ask a question about our current format. In the current
format, we use a keyword to specify the type followed by parenthesis
around a specially formatted string. The uses spaces and commas to
separate numeric values for defining the given geo data type. Why use
a string with a special string format?
Current Examples:
Point : point("80.10d, -10E5")
Line : line("10.1234,11.1e-1 +10.2E-2,-11.22")
Rectangle : rectangle("5.1,11.8 87.6,15.6548")
Circle : circle("10.1234,1.11 0.102")
Polygon : polygon("-1.2,+1.3e2 -2.14E+5,2.15 -3.5e+2,03.6 -4.6E-3,+4.81")
Is there a reason you would not want to use numeric types instead of
specially defined string? Or even reused types to define new types
like using points to define a line. The following are some examples of
how we could reuse AsterixDB types to define points, lines, etc.:
Type Based Example
Point : point(double, double)
Line : line(point(double,double), point(double,double))
Rectangle : rectangle(point(double,double), point(double,double))
Circle : circle(point(double,double),double)
Polygon : polygon(point(double,double), point(double,double),
point(double,double), point(double,double))
It seems the other formats we are looking at reuse numeric type in
their type definitions. Thoughts?
[1] http://asterixdb.apache.org/docs/0.9.1/datamodel.html#PrimitiveTypesPoint
[2] https://issues.apache.org/jira/browse/ASTERIXDB-1371
Re: ASTERIXDB-1371: Geo data type format question
Posted by Preston Carman <pr...@apache.org>.
Nice discussion.
In my work with Intervals, we standardized the format to be consistent
between ADM and AQL. The discussion is here:
http://www.mail-archive.com/dev@asterixdb.incubator.apache.org/msg03180.html
Documentation links:
http://asterixdb.apache.org/docs/0.9.1/datamodel.html#PrimitiveTypesInterval
http://asterixdb.apache.org/docs/0.9.1/sqlpp/builtins.html#TemporalFunctions
On Sun, May 14, 2017 at 11:21 AM, Wail Alkowaileet <wa...@gmail.com> wrote:
> Just for reference, two years ago we had a discussion about serialization
> for clean JSON:
>
> http://www.mail-archive.com/dev@asterixdb.incubator.apache.org/msg00882.html
>
> On Sun, May 14, 2017 at 9:08 PM, Preston Carman <pr...@apache.org> wrote:
>
>> Thanks for pointing out we have functions that provide a way to create
>> the data using numeric values. As a review, we have functions to
>> create points using numeric types and the serialized form (ADM) holds
>> the special string format.
>>
>> function: create_point(47.44,80.65)
>> adm: point("47.44,80.65")
>>
>> On Sun, May 14, 2017 at 10:58 AM, Wail Alkowaileet <wa...@gmail.com>
>> wrote:
>> > Sorry ! For some reason I missed a whole page.
>> >
>> > On Sun, May 14, 2017 at 8:54 PM, Yingyi Bu <bu...@gmail.com> wrote:
>> >
>> >> Hi Wail,
>> >>
>> >> They're documented at:
>> >> https://ci.apache.org/projects/asterixdb/aql/
>> >> builtins.html#SpatialFunctions
>> >> The prefixes in the documentation are "create_".
>> >>
>> >> Best,
>> >> Yingyi
>> >>
>> >> On Sun, May 14, 2017 at 10:51 AM, Wail Alkowaileet <wa...@gmail.com>
>> >> wrote:
>> >>
>> >> > Previously, AsterixDB used to have such functions [1] prefixed with
>> >> > "create-*()". The functions are still in the master [2] .. but not
>> >> > documented.
>> >> > For the current spatial constructors, I think they're inspired by
>> WKT. I
>> >> > cannot be helpful on explaining the reason why... sorry!
>> >> >
>> >> > [1]
>> >> > https://github.com/apache/asterixdb/blob/release-0.8.7/
>> >> > asterix-doc/src/site/markdown/aql/functions.md
>> >> > [2]
>> >> > https://github.com/apache/asterixdb/blob/master/
>> >> > asterixdb/asterix-om/src/main/java/org/apache/asterix/om/
>> >> > functions/BuiltinFunctions.java
>> >> >
>> >> > On Sun, May 14, 2017 at 8:00 PM, Preston Carman <pr...@apache.org>
>> >> > wrote:
>> >> >
>> >> > > I have question about the format used by AsterixDB to store points,
>> >> > > lines, etc.[1]. As we are adding support for other formats [2], I
>> >> > > wanted to ask a question about our current format. In the current
>> >> > > format, we use a keyword to specify the type followed by parenthesis
>> >> > > around a specially formatted string. The uses spaces and commas to
>> >> > > separate numeric values for defining the given geo data type. Why
>> use
>> >> > > a string with a special string format?
>> >> > >
>> >> > > Current Examples:
>> >> > > Point : point("80.10d, -10E5")
>> >> > > Line : line("10.1234,11.1e-1 +10.2E-2,-11.22")
>> >> > > Rectangle : rectangle("5.1,11.8 87.6,15.6548")
>> >> > > Circle : circle("10.1234,1.11 0.102")
>> >> > > Polygon : polygon("-1.2,+1.3e2 -2.14E+5,2.15 -3.5e+2,03.6
>> >> -4.6E-3,+4.81")
>> >> > >
>> >> > > Is there a reason you would not want to use numeric types instead of
>> >> > > specially defined string? Or even reused types to define new types
>> >> > > like using points to define a line. The following are some examples
>> of
>> >> > > how we could reuse AsterixDB types to define points, lines, etc.:
>> >> > >
>> >> > > Type Based Example
>> >> > > Point : point(double, double)
>> >> > > Line : line(point(double,double), point(double,double))
>> >> > > Rectangle : rectangle(point(double,double), point(double,double))
>> >> > > Circle : circle(point(double,double),double)
>> >> > > Polygon : polygon(point(double,double), point(double,double),
>> >> > > point(double,double), point(double,double))
>> >> > >
>> >> > > It seems the other formats we are looking at reuse numeric type in
>> >> > > their type definitions. Thoughts?
>> >> > >
>> >> > > [1] http://asterixdb.apache.org/docs/0.9.1/datamodel.html#
>> >> > > PrimitiveTypesPoint
>> >> > > [2] https://issues.apache.org/jira/browse/ASTERIXDB-1371
>> >> > >
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> >
>> >> > *Regards,*
>> >> > Wail Alkowaileet
>> >> >
>> >>
>> >
>> >
>> >
>> > --
>> >
>> > *Regards,*
>> > Wail Alkowaileet
>>
>
>
>
> --
>
> *Regards,*
> Wail Alkowaileet
Re: ASTERIXDB-1371: Geo data type format question
Posted by Wail Alkowaileet <wa...@gmail.com>.
Just for reference, two years ago we had a discussion about serialization
for clean JSON:
http://www.mail-archive.com/dev@asterixdb.incubator.apache.org/msg00882.html
On Sun, May 14, 2017 at 9:08 PM, Preston Carman <pr...@apache.org> wrote:
> Thanks for pointing out we have functions that provide a way to create
> the data using numeric values. As a review, we have functions to
> create points using numeric types and the serialized form (ADM) holds
> the special string format.
>
> function: create_point(47.44,80.65)
> adm: point("47.44,80.65")
>
> On Sun, May 14, 2017 at 10:58 AM, Wail Alkowaileet <wa...@gmail.com>
> wrote:
> > Sorry ! For some reason I missed a whole page.
> >
> > On Sun, May 14, 2017 at 8:54 PM, Yingyi Bu <bu...@gmail.com> wrote:
> >
> >> Hi Wail,
> >>
> >> They're documented at:
> >> https://ci.apache.org/projects/asterixdb/aql/
> >> builtins.html#SpatialFunctions
> >> The prefixes in the documentation are "create_".
> >>
> >> Best,
> >> Yingyi
> >>
> >> On Sun, May 14, 2017 at 10:51 AM, Wail Alkowaileet <wa...@gmail.com>
> >> wrote:
> >>
> >> > Previously, AsterixDB used to have such functions [1] prefixed with
> >> > "create-*()". The functions are still in the master [2] .. but not
> >> > documented.
> >> > For the current spatial constructors, I think they're inspired by
> WKT. I
> >> > cannot be helpful on explaining the reason why... sorry!
> >> >
> >> > [1]
> >> > https://github.com/apache/asterixdb/blob/release-0.8.7/
> >> > asterix-doc/src/site/markdown/aql/functions.md
> >> > [2]
> >> > https://github.com/apache/asterixdb/blob/master/
> >> > asterixdb/asterix-om/src/main/java/org/apache/asterix/om/
> >> > functions/BuiltinFunctions.java
> >> >
> >> > On Sun, May 14, 2017 at 8:00 PM, Preston Carman <pr...@apache.org>
> >> > wrote:
> >> >
> >> > > I have question about the format used by AsterixDB to store points,
> >> > > lines, etc.[1]. As we are adding support for other formats [2], I
> >> > > wanted to ask a question about our current format. In the current
> >> > > format, we use a keyword to specify the type followed by parenthesis
> >> > > around a specially formatted string. The uses spaces and commas to
> >> > > separate numeric values for defining the given geo data type. Why
> use
> >> > > a string with a special string format?
> >> > >
> >> > > Current Examples:
> >> > > Point : point("80.10d, -10E5")
> >> > > Line : line("10.1234,11.1e-1 +10.2E-2,-11.22")
> >> > > Rectangle : rectangle("5.1,11.8 87.6,15.6548")
> >> > > Circle : circle("10.1234,1.11 0.102")
> >> > > Polygon : polygon("-1.2,+1.3e2 -2.14E+5,2.15 -3.5e+2,03.6
> >> -4.6E-3,+4.81")
> >> > >
> >> > > Is there a reason you would not want to use numeric types instead of
> >> > > specially defined string? Or even reused types to define new types
> >> > > like using points to define a line. The following are some examples
> of
> >> > > how we could reuse AsterixDB types to define points, lines, etc.:
> >> > >
> >> > > Type Based Example
> >> > > Point : point(double, double)
> >> > > Line : line(point(double,double), point(double,double))
> >> > > Rectangle : rectangle(point(double,double), point(double,double))
> >> > > Circle : circle(point(double,double),double)
> >> > > Polygon : polygon(point(double,double), point(double,double),
> >> > > point(double,double), point(double,double))
> >> > >
> >> > > It seems the other formats we are looking at reuse numeric type in
> >> > > their type definitions. Thoughts?
> >> > >
> >> > > [1] http://asterixdb.apache.org/docs/0.9.1/datamodel.html#
> >> > > PrimitiveTypesPoint
> >> > > [2] https://issues.apache.org/jira/browse/ASTERIXDB-1371
> >> > >
> >> >
> >> >
> >> >
> >> > --
> >> >
> >> > *Regards,*
> >> > Wail Alkowaileet
> >> >
> >>
> >
> >
> >
> > --
> >
> > *Regards,*
> > Wail Alkowaileet
>
--
*Regards,*
Wail Alkowaileet
Re: ASTERIXDB-1371: Geo data type format question
Posted by Preston Carman <pr...@apache.org>.
Thanks for pointing out we have functions that provide a way to create
the data using numeric values. As a review, we have functions to
create points using numeric types and the serialized form (ADM) holds
the special string format.
function: create_point(47.44,80.65)
adm: point("47.44,80.65")
On Sun, May 14, 2017 at 10:58 AM, Wail Alkowaileet <wa...@gmail.com> wrote:
> Sorry ! For some reason I missed a whole page.
>
> On Sun, May 14, 2017 at 8:54 PM, Yingyi Bu <bu...@gmail.com> wrote:
>
>> Hi Wail,
>>
>> They're documented at:
>> https://ci.apache.org/projects/asterixdb/aql/
>> builtins.html#SpatialFunctions
>> The prefixes in the documentation are "create_".
>>
>> Best,
>> Yingyi
>>
>> On Sun, May 14, 2017 at 10:51 AM, Wail Alkowaileet <wa...@gmail.com>
>> wrote:
>>
>> > Previously, AsterixDB used to have such functions [1] prefixed with
>> > "create-*()". The functions are still in the master [2] .. but not
>> > documented.
>> > For the current spatial constructors, I think they're inspired by WKT. I
>> > cannot be helpful on explaining the reason why... sorry!
>> >
>> > [1]
>> > https://github.com/apache/asterixdb/blob/release-0.8.7/
>> > asterix-doc/src/site/markdown/aql/functions.md
>> > [2]
>> > https://github.com/apache/asterixdb/blob/master/
>> > asterixdb/asterix-om/src/main/java/org/apache/asterix/om/
>> > functions/BuiltinFunctions.java
>> >
>> > On Sun, May 14, 2017 at 8:00 PM, Preston Carman <pr...@apache.org>
>> > wrote:
>> >
>> > > I have question about the format used by AsterixDB to store points,
>> > > lines, etc.[1]. As we are adding support for other formats [2], I
>> > > wanted to ask a question about our current format. In the current
>> > > format, we use a keyword to specify the type followed by parenthesis
>> > > around a specially formatted string. The uses spaces and commas to
>> > > separate numeric values for defining the given geo data type. Why use
>> > > a string with a special string format?
>> > >
>> > > Current Examples:
>> > > Point : point("80.10d, -10E5")
>> > > Line : line("10.1234,11.1e-1 +10.2E-2,-11.22")
>> > > Rectangle : rectangle("5.1,11.8 87.6,15.6548")
>> > > Circle : circle("10.1234,1.11 0.102")
>> > > Polygon : polygon("-1.2,+1.3e2 -2.14E+5,2.15 -3.5e+2,03.6
>> -4.6E-3,+4.81")
>> > >
>> > > Is there a reason you would not want to use numeric types instead of
>> > > specially defined string? Or even reused types to define new types
>> > > like using points to define a line. The following are some examples of
>> > > how we could reuse AsterixDB types to define points, lines, etc.:
>> > >
>> > > Type Based Example
>> > > Point : point(double, double)
>> > > Line : line(point(double,double), point(double,double))
>> > > Rectangle : rectangle(point(double,double), point(double,double))
>> > > Circle : circle(point(double,double),double)
>> > > Polygon : polygon(point(double,double), point(double,double),
>> > > point(double,double), point(double,double))
>> > >
>> > > It seems the other formats we are looking at reuse numeric type in
>> > > their type definitions. Thoughts?
>> > >
>> > > [1] http://asterixdb.apache.org/docs/0.9.1/datamodel.html#
>> > > PrimitiveTypesPoint
>> > > [2] https://issues.apache.org/jira/browse/ASTERIXDB-1371
>> > >
>> >
>> >
>> >
>> > --
>> >
>> > *Regards,*
>> > Wail Alkowaileet
>> >
>>
>
>
>
> --
>
> *Regards,*
> Wail Alkowaileet
Re: ASTERIXDB-1371: Geo data type format question
Posted by Wail Alkowaileet <wa...@gmail.com>.
Sorry ! For some reason I missed a whole page.
On Sun, May 14, 2017 at 8:54 PM, Yingyi Bu <bu...@gmail.com> wrote:
> Hi Wail,
>
> They're documented at:
> https://ci.apache.org/projects/asterixdb/aql/
> builtins.html#SpatialFunctions
> The prefixes in the documentation are "create_".
>
> Best,
> Yingyi
>
> On Sun, May 14, 2017 at 10:51 AM, Wail Alkowaileet <wa...@gmail.com>
> wrote:
>
> > Previously, AsterixDB used to have such functions [1] prefixed with
> > "create-*()". The functions are still in the master [2] .. but not
> > documented.
> > For the current spatial constructors, I think they're inspired by WKT. I
> > cannot be helpful on explaining the reason why... sorry!
> >
> > [1]
> > https://github.com/apache/asterixdb/blob/release-0.8.7/
> > asterix-doc/src/site/markdown/aql/functions.md
> > [2]
> > https://github.com/apache/asterixdb/blob/master/
> > asterixdb/asterix-om/src/main/java/org/apache/asterix/om/
> > functions/BuiltinFunctions.java
> >
> > On Sun, May 14, 2017 at 8:00 PM, Preston Carman <pr...@apache.org>
> > wrote:
> >
> > > I have question about the format used by AsterixDB to store points,
> > > lines, etc.[1]. As we are adding support for other formats [2], I
> > > wanted to ask a question about our current format. In the current
> > > format, we use a keyword to specify the type followed by parenthesis
> > > around a specially formatted string. The uses spaces and commas to
> > > separate numeric values for defining the given geo data type. Why use
> > > a string with a special string format?
> > >
> > > Current Examples:
> > > Point : point("80.10d, -10E5")
> > > Line : line("10.1234,11.1e-1 +10.2E-2,-11.22")
> > > Rectangle : rectangle("5.1,11.8 87.6,15.6548")
> > > Circle : circle("10.1234,1.11 0.102")
> > > Polygon : polygon("-1.2,+1.3e2 -2.14E+5,2.15 -3.5e+2,03.6
> -4.6E-3,+4.81")
> > >
> > > Is there a reason you would not want to use numeric types instead of
> > > specially defined string? Or even reused types to define new types
> > > like using points to define a line. The following are some examples of
> > > how we could reuse AsterixDB types to define points, lines, etc.:
> > >
> > > Type Based Example
> > > Point : point(double, double)
> > > Line : line(point(double,double), point(double,double))
> > > Rectangle : rectangle(point(double,double), point(double,double))
> > > Circle : circle(point(double,double),double)
> > > Polygon : polygon(point(double,double), point(double,double),
> > > point(double,double), point(double,double))
> > >
> > > It seems the other formats we are looking at reuse numeric type in
> > > their type definitions. Thoughts?
> > >
> > > [1] http://asterixdb.apache.org/docs/0.9.1/datamodel.html#
> > > PrimitiveTypesPoint
> > > [2] https://issues.apache.org/jira/browse/ASTERIXDB-1371
> > >
> >
> >
> >
> > --
> >
> > *Regards,*
> > Wail Alkowaileet
> >
>
--
*Regards,*
Wail Alkowaileet
Re: ASTERIXDB-1371: Geo data type format question
Posted by Yingyi Bu <bu...@gmail.com>.
Hi Wail,
They're documented at:
https://ci.apache.org/projects/asterixdb/aql/builtins.html#SpatialFunctions
The prefixes in the documentation are "create_".
Best,
Yingyi
On Sun, May 14, 2017 at 10:51 AM, Wail Alkowaileet <wa...@gmail.com>
wrote:
> Previously, AsterixDB used to have such functions [1] prefixed with
> "create-*()". The functions are still in the master [2] .. but not
> documented.
> For the current spatial constructors, I think they're inspired by WKT. I
> cannot be helpful on explaining the reason why... sorry!
>
> [1]
> https://github.com/apache/asterixdb/blob/release-0.8.7/
> asterix-doc/src/site/markdown/aql/functions.md
> [2]
> https://github.com/apache/asterixdb/blob/master/
> asterixdb/asterix-om/src/main/java/org/apache/asterix/om/
> functions/BuiltinFunctions.java
>
> On Sun, May 14, 2017 at 8:00 PM, Preston Carman <pr...@apache.org>
> wrote:
>
> > I have question about the format used by AsterixDB to store points,
> > lines, etc.[1]. As we are adding support for other formats [2], I
> > wanted to ask a question about our current format. In the current
> > format, we use a keyword to specify the type followed by parenthesis
> > around a specially formatted string. The uses spaces and commas to
> > separate numeric values for defining the given geo data type. Why use
> > a string with a special string format?
> >
> > Current Examples:
> > Point : point("80.10d, -10E5")
> > Line : line("10.1234,11.1e-1 +10.2E-2,-11.22")
> > Rectangle : rectangle("5.1,11.8 87.6,15.6548")
> > Circle : circle("10.1234,1.11 0.102")
> > Polygon : polygon("-1.2,+1.3e2 -2.14E+5,2.15 -3.5e+2,03.6 -4.6E-3,+4.81")
> >
> > Is there a reason you would not want to use numeric types instead of
> > specially defined string? Or even reused types to define new types
> > like using points to define a line. The following are some examples of
> > how we could reuse AsterixDB types to define points, lines, etc.:
> >
> > Type Based Example
> > Point : point(double, double)
> > Line : line(point(double,double), point(double,double))
> > Rectangle : rectangle(point(double,double), point(double,double))
> > Circle : circle(point(double,double),double)
> > Polygon : polygon(point(double,double), point(double,double),
> > point(double,double), point(double,double))
> >
> > It seems the other formats we are looking at reuse numeric type in
> > their type definitions. Thoughts?
> >
> > [1] http://asterixdb.apache.org/docs/0.9.1/datamodel.html#
> > PrimitiveTypesPoint
> > [2] https://issues.apache.org/jira/browse/ASTERIXDB-1371
> >
>
>
>
> --
>
> *Regards,*
> Wail Alkowaileet
>
Re: ASTERIXDB-1371: Geo data type format question
Posted by Wail Alkowaileet <wa...@gmail.com>.
Previously, AsterixDB used to have such functions [1] prefixed with
"create-*()". The functions are still in the master [2] .. but not
documented.
For the current spatial constructors, I think they're inspired by WKT. I
cannot be helpful on explaining the reason why... sorry!
[1]
https://github.com/apache/asterixdb/blob/release-0.8.7/asterix-doc/src/site/markdown/aql/functions.md
[2]
https://github.com/apache/asterixdb/blob/master/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/functions/BuiltinFunctions.java
On Sun, May 14, 2017 at 8:00 PM, Preston Carman <pr...@apache.org> wrote:
> I have question about the format used by AsterixDB to store points,
> lines, etc.[1]. As we are adding support for other formats [2], I
> wanted to ask a question about our current format. In the current
> format, we use a keyword to specify the type followed by parenthesis
> around a specially formatted string. The uses spaces and commas to
> separate numeric values for defining the given geo data type. Why use
> a string with a special string format?
>
> Current Examples:
> Point : point("80.10d, -10E5")
> Line : line("10.1234,11.1e-1 +10.2E-2,-11.22")
> Rectangle : rectangle("5.1,11.8 87.6,15.6548")
> Circle : circle("10.1234,1.11 0.102")
> Polygon : polygon("-1.2,+1.3e2 -2.14E+5,2.15 -3.5e+2,03.6 -4.6E-3,+4.81")
>
> Is there a reason you would not want to use numeric types instead of
> specially defined string? Or even reused types to define new types
> like using points to define a line. The following are some examples of
> how we could reuse AsterixDB types to define points, lines, etc.:
>
> Type Based Example
> Point : point(double, double)
> Line : line(point(double,double), point(double,double))
> Rectangle : rectangle(point(double,double), point(double,double))
> Circle : circle(point(double,double),double)
> Polygon : polygon(point(double,double), point(double,double),
> point(double,double), point(double,double))
>
> It seems the other formats we are looking at reuse numeric type in
> their type definitions. Thoughts?
>
> [1] http://asterixdb.apache.org/docs/0.9.1/datamodel.html#
> PrimitiveTypesPoint
> [2] https://issues.apache.org/jira/browse/ASTERIXDB-1371
>
--
*Regards,*
Wail Alkowaileet