[ 
https://issues.apache.org/jira/browse/ASTERIXDB-1665?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Till updated ASTERIXDB-1665:
----------------------------
    Description: 
Suppose you have a beers dataset containing the following untyped JSON beer 
records.  (Note that beers.abv is numeric but non-integer data.)
{noformat}
{ "name": "Black Sand Porter", "abv": 0.0, "ibu": 0.0, "srm": 0.0, "upc": 0, 
"type": "beer", "brewery_id": "kona_brewing", "updated": "2010-07-22 20:00:20", 
"description": "", "style": "Porter", "category": "Irish Ale" }
{ "name": "Fire Rock Pale Ale", "abv": 5.8, "ibu": 0.0, "srm": 0.0, "upc": 0, 
"type": "beer", "brewery_id": "kona_brewing", "updated": "2010-07-22 20:00:20", 
"description": "", "style": "American-Style Pale Ale", "category": "North 
American Ale" }
{ "name": "Lilikoi Wheat Ale", "abv": 0.0, "ibu": 0.0, "srm": 0.0, "upc": 0, 
"type": "beer", "brewery_id": "kona_brewing", "updated": "2010-07-22 20:00:20", 
"description": "", "style": "Light American Wheat Ale or Lager", "category": 
"Other Style" }
{ "name": "Longboard Lager", "abv": 5.5, "ibu": 0.0, "srm": 0.0, "upc": 0, 
"type": "beer", "brewery_id": "kona_brewing", "updated": "2010-07-22 20:00:20", 
"description": "", "style": "American-Style Lager", "category": "North American 
Lager" }
{ "name": "Pipeline Porter", "abv": 0.0, "ibu": 0.0, "srm": 0.0, "upc": 0, 
"type": "beer", "brewery_id": "kona_brewing", "updated": "2010-07-22 20:00:20", 
"description": "Pipeline Porter is smooth and dark with a distinctive roasty 
aroma and earthy complexity from its diverse blends of premium malted barley. 
This celebration of malt unites with freshly roasted 100% Kona coffee grown at 
Cornwell Estate on Hawaii’s Big Island, lending a unique roasted aroma and 
flavor. A delicate blend of hops rounds out this palate-pleasing brew.", 
"style": "Porter", "category": "Irish Ale" }
{ "name": "Stout", "abv": 0.0, "ibu": 0.0, "srm": 0.0, "upc": 0, "type": 
"beer", "brewery_id": "kona_brewing", "updated": "2010-07-22 20:00:20", 
"description": "", "style": "American-Style Stout", "category": "North American 
Ale" }
{ "name": "Wailua", "abv": 0.0, "ibu": 0.0, "srm": 0.0, "upc": 0, "type": 
"beer", "brewery_id": "kona_brewing", "updated": "2010-07-22 20:00:20", 
"description": "Wailua is Hawaiian for two fresh water streams mingling. This 
was just the inspiration we needed for our Limited Release wheat ale brewed 
with tropical passion Fruit. A refreshing citrusy, sun-colored ale with the 
cool taste of Hawaii.", "style": "Light American Wheat Ale or Lager", 
"category": "Other Style" }
{noformat}
Suppose you now try to index beers.abv as follows:
{noformat}
CREATE INDEX beer_abv_index ON beers (abv: int?) ENFORCED;
{noformat}

This will succeed - but I believe it should NOT since you can't properly index 
non-integer data with an integer index.  (Right?)

Note that if you say:
{noformat}
CREATE INDEX  beer_abv_index ON beers (abv: string?) ENFORCED;
{noformat}

You properly get yelled at:
{noformat}
ASX0000: Field type DOUBLE can't be promoted to type STRING 
[HyracksDataException]
{noformat}

I would have expected a similar response with INT in place of STRING...?

Assigning to Till for an initial sanity check and then reassignment to someone 
to fix it (Steven probably, since this was UCR work :-)).

  was:
Suppose you have a beers dataset containing the following untyped JSON beer 
records.  (Note that beers.abv is numeric but non-integer data.)

{ "name": "Black Sand Porter", "abv": 0.0, "ibu": 0.0, "srm": 0.0, "upc": 0, 
"type": "beer", "brewery_id": "kona_brewing", "updated": "2010-07-22 20:00:20", 
"description": "", "style": "Porter", "category": "Irish Ale" }
{ "name": "Fire Rock Pale Ale", "abv": 5.8, "ibu": 0.0, "srm": 0.0, "upc": 0, 
"type": "beer", "brewery_id": "kona_brewing", "updated": "2010-07-22 20:00:20", 
"description": "", "style": "American-Style Pale Ale", "category": "North 
American Ale" }
{ "name": "Lilikoi Wheat Ale", "abv": 0.0, "ibu": 0.0, "srm": 0.0, "upc": 0, 
"type": "beer", "brewery_id": "kona_brewing", "updated": "2010-07-22 20:00:20", 
"description": "", "style": "Light American Wheat Ale or Lager", "category": 
"Other Style" }
{ "name": "Longboard Lager", "abv": 5.5, "ibu": 0.0, "srm": 0.0, "upc": 0, 
"type": "beer", "brewery_id": "kona_brewing", "updated": "2010-07-22 20:00:20", 
"description": "", "style": "American-Style Lager", "category": "North American 
Lager" }
{ "name": "Pipeline Porter", "abv": 0.0, "ibu": 0.0, "srm": 0.0, "upc": 0, 
"type": "beer", "brewery_id": "kona_brewing", "updated": "2010-07-22 20:00:20", 
"description": "Pipeline Porter is smooth and dark with a distinctive roasty 
aroma and earthy complexity from its diverse blends of premium malted barley. 
This celebration of malt unites with freshly roasted 100% Kona coffee grown at 
Cornwell Estate on Hawaii’s Big Island, lending a unique roasted aroma and 
flavor. A delicate blend of hops rounds out this palate-pleasing brew.", 
"style": "Porter", "category": "Irish Ale" }
{ "name": "Stout", "abv": 0.0, "ibu": 0.0, "srm": 0.0, "upc": 0, "type": 
"beer", "brewery_id": "kona_brewing", "updated": "2010-07-22 20:00:20", 
"description": "", "style": "American-Style Stout", "category": "North American 
Ale" }
{ "name": "Wailua", "abv": 0.0, "ibu": 0.0, "srm": 0.0, "upc": 0, "type": 
"beer", "brewery_id": "kona_brewing", "updated": "2010-07-22 20:00:20", 
"description": "Wailua is Hawaiian for two fresh water streams mingling. This 
was just the inspiration we needed for our Limited Release wheat ale brewed 
with tropical passion Fruit. A refreshing citrusy, sun-colored ale with the 
cool taste of Hawaii.", "style": "Light American Wheat Ale or Lager", 
"category": "Other Style" }

Suppose you now try to index beers.abv as follows:
CREATE INDEX beer_abv_index ON beers (abv: int?) ENFORCED;

This will succeed - but I believe it should NOT since you can't properly index 
non-integer data with an integer index.  (Right?)

Note that if you say:
CREATE INDEX  beer_abv_index ON beers (abv: string?) ENFORCED;

You properly get yelled at:
ASX0000: Field type DOUBLE can't be promoted to type STRING 
[HyracksDataException]

I would have expected a similar response with INT in place of STRING...?

Assigning to Till for an initial sanity check and then reassignment to someone 
to fix it (Steven probably, since this was UCR work :-)).


> Open indexes on non-int numbers aren't properly ENFORCED
> --------------------------------------------------------
>
>                 Key: ASTERIXDB-1665
>                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-1665
>             Project: Apache AsterixDB
>          Issue Type: Bug
>          Components: AsterixDB, Optimizer, Other
>         Environment: AsterixDB master and Mac OSX
>            Reporter: Michael J. Carey
>            Assignee: Till
>
> Suppose you have a beers dataset containing the following untyped JSON beer 
> records.  (Note that beers.abv is numeric but non-integer data.)
> {noformat}
> { "name": "Black Sand Porter", "abv": 0.0, "ibu": 0.0, "srm": 0.0, "upc": 0, 
> "type": "beer", "brewery_id": "kona_brewing", "updated": "2010-07-22 
> 20:00:20", "description": "", "style": "Porter", "category": "Irish Ale" }
> { "name": "Fire Rock Pale Ale", "abv": 5.8, "ibu": 0.0, "srm": 0.0, "upc": 0, 
> "type": "beer", "brewery_id": "kona_brewing", "updated": "2010-07-22 
> 20:00:20", "description": "", "style": "American-Style Pale Ale", "category": 
> "North American Ale" }
> { "name": "Lilikoi Wheat Ale", "abv": 0.0, "ibu": 0.0, "srm": 0.0, "upc": 0, 
> "type": "beer", "brewery_id": "kona_brewing", "updated": "2010-07-22 
> 20:00:20", "description": "", "style": "Light American Wheat Ale or Lager", 
> "category": "Other Style" }
> { "name": "Longboard Lager", "abv": 5.5, "ibu": 0.0, "srm": 0.0, "upc": 0, 
> "type": "beer", "brewery_id": "kona_brewing", "updated": "2010-07-22 
> 20:00:20", "description": "", "style": "American-Style Lager", "category": 
> "North American Lager" }
> { "name": "Pipeline Porter", "abv": 0.0, "ibu": 0.0, "srm": 0.0, "upc": 0, 
> "type": "beer", "brewery_id": "kona_brewing", "updated": "2010-07-22 
> 20:00:20", "description": "Pipeline Porter is smooth and dark with a 
> distinctive roasty aroma and earthy complexity from its diverse blends of 
> premium malted barley. This celebration of malt unites with freshly roasted 
> 100% Kona coffee grown at Cornwell Estate on Hawaii’s Big Island, lending a 
> unique roasted aroma and flavor. A delicate blend of hops rounds out this 
> palate-pleasing brew.", "style": "Porter", "category": "Irish Ale" }
> { "name": "Stout", "abv": 0.0, "ibu": 0.0, "srm": 0.0, "upc": 0, "type": 
> "beer", "brewery_id": "kona_brewing", "updated": "2010-07-22 20:00:20", 
> "description": "", "style": "American-Style Stout", "category": "North 
> American Ale" }
> { "name": "Wailua", "abv": 0.0, "ibu": 0.0, "srm": 0.0, "upc": 0, "type": 
> "beer", "brewery_id": "kona_brewing", "updated": "2010-07-22 20:00:20", 
> "description": "Wailua is Hawaiian for two fresh water streams mingling. This 
> was just the inspiration we needed for our Limited Release wheat ale brewed 
> with tropical passion Fruit. A refreshing citrusy, sun-colored ale with the 
> cool taste of Hawaii.", "style": "Light American Wheat Ale or Lager", 
> "category": "Other Style" }
> {noformat}
> Suppose you now try to index beers.abv as follows:
> {noformat}
> CREATE INDEX beer_abv_index ON beers (abv: int?) ENFORCED;
> {noformat}
> This will succeed - but I believe it should NOT since you can't properly 
> index non-integer data with an integer index.  (Right?)
> Note that if you say:
> {noformat}
> CREATE INDEX  beer_abv_index ON beers (abv: string?) ENFORCED;
> {noformat}
> You properly get yelled at:
> {noformat}
> ASX0000: Field type DOUBLE can't be promoted to type STRING 
> [HyracksDataException]
> {noformat}
> I would have expected a similar response with INT in place of STRING...?
> Assigning to Till for an initial sanity check and then reassignment to 
> someone to fix it (Steven probably, since this was UCR work :-)).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to