Skip to main content
Question

avro external table

  • December 21, 2018
  • 6 replies
  • 13 views

Vertica_Curtis
Forum|alt.badge.img+1

Is there a solution for this?

create flex table avro_sample() ;

dbadmin=> copy avro_sample from 's3://vertica-metadata-s3/twitter.avro' parser favroparser() ;

Rows Loaded

       2

(1 row)

dbadmin=> SELECT compute_flextable_keys_and_build_view ('avro_sample') ;

compute_flextable_keys_and_build_view

Please see public.avro_sample_keys for updated keys
The view public.avro_sample_view is ready for querying
(1 row)

dbadmin=> create flex external table avro_test() as copy from 's3://vertica-metadata-s3/twitter.avro' parser favroparser() ;
CREATE TABLE
dbadmin=> select * From avro_Test ;
identity | raw
--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
250001 | \001\000\000\000U\000\000\000\004\000\000\000\024\000\000\000"\000\000\000,\000\000\000O\000\000\000twitter_schema1366150681Rock: Nerf paper, scissors is fine.miguno\004\000\000\000\024\000\000\000\034\000\000\000%\000\000\000\000\000\000__name__timestamptweetusername
250002 | \001\000\000\000Y\000\000\000\004\000\000\000\024\000\000\000"\000\000\000,\000\000\000O\000\000\000twitter_schema1366154481Works as intended. Terran is IMBA.BlizzardCS\004\000\000\000\024\000\000\000\034\000\000\000%\000\000\000
\000\000\000__name__timestamptweetusername
(2 rows)

dbadmin=> SELECT compute_flextable_keys_and_build_view ('avro_Test') ;
ERROR 7160: Cannot expand glob pattern due to error: The request signature we calculated does not match the signature you provided. Check your key and signing method.

If I run the compute_flextable.. against the flex table that I create and then load externally, it works OK. But if I try to compute against the external flex table, it fails.

6 replies

Jim_Knicely
Forum|alt.badge.img+2
  • Participating Frequently
  • December 26, 2018

Hi Curtis,

Thanks for sending me the Avro file.

If I copy it to a local file system, and use Vertica 9.2, it works okay...

Example:

dbadmin=> create flex table avro_sample() ;
CREATE TABLE

dbadmin=> copy avro_sample from '/home/dbadmin/twitter.avro' parser favroparser();
 Rows Loaded
-------------
           2
(1 row)

dbadmin=> SELECT compute_flextable_keys_and_build_view ('avro_sample');
                                   compute_flextable_keys_and_build_view
------------------------------------------------------------------------------------------------------------
 Please see public.avro_sample_keys for updated keys
The view public.avro_sample_view is ready for querying
(1 row)

dbadmin=> SELECT * FROM public.avro_sample_view;
    __name__    | timestamp  |                tweet                |  username
----------------+------------+-------------------------------------+------------
 twitter_schema | 1366150681 | Rock: Nerf paper, scissors is fine. | miguno
 twitter_schema | 1366154481 | Works as intended.  Terran is IMBA. | BlizzardCS
(2 rows)

dbadmin=> create flex external table avro_test() as copy from '/home/dbadmin/twitter.avro' parser favroparser();
CREATE TABLE

dbadmin=> SELECT compute_flextable_keys_and_build_view ('avro_test') ;
                                 compute_flextable_keys_and_build_view
--------------------------------------------------------------------------------------------------------
 Please see public.avro_test_keys for updated keys
The view public.avro_test_view is ready for querying
(1 row)

dbadmin=> SELECT * FROM public.avro_test_view;
    __name__    | timestamp  |                tweet                |  username
----------------+------------+-------------------------------------+------------
 twitter_schema | 1366150681 | Rock: Nerf paper, scissors is fine. | miguno
 twitter_schema | 1366154481 | Works as intended.  Terran is IMBA. | BlizzardCS
(2 rows)

Vertica_Curtis
Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • December 26, 2018

Yea, it seems to be only an issue when it resides on s3. Not sure why. My guess is it's a bug.


Jim_Knicely
Forum|alt.badge.img+2
  • Participating Frequently
  • December 26, 2018

Seems okay from my bucket...

dbadmin=> drop table avro_test;
DROP TABLE

dbadmin=> create flex external table avro_test() as copy from 's3://knicely-vertica/twitter.avro' parser favroparser() ;
CREATE TABLE

dbadmin=> SELECT compute_flextable_keys_and_build_view ('avro_test') ;
                                 compute_flextable_keys_and_build_view
--------------------------------------------------------------------------------------------------------
 Please see public.avro_test_keys for updated keys
The view public.avro_test_view is ready for querying
(1 row)

dbadmin=> SELECT * FROM public.avro_test_view;
    __name__    | timestamp  |                tweet                |  username
----------------+------------+-------------------------------------+------------
 twitter_schema | 1366150681 | Rock: Nerf paper, scissors is fine. | miguno
 twitter_schema | 1366154481 | Works as intended.  Terran is IMBA. | BlizzardCS
(2 rows)

Vertica_Curtis
Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • December 26, 2018
Ok that's super weird. Now I'm convinced it's a bug.

Vertica_Curtis
Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • December 26, 2018

Ok, Jim and I figured this out (mostly Jim). Seems if you don't have the AWSAuth value set correctly, you get this error (this horrible, worthless error). But oddly, you can LOAD the file correctly, just not compute the keys on it. Weird. This can be solved by either setting the permissions on the file itself (Setting the permissions on the bucket don't seem to do it) - to public READ access. Again, setting the permissions on the bucket don't seem to work. It has to be set on the file. Or, setting the AWSAuth will fix it.

I have created JIRA ver-65602 for this.


Jim_Knicely
Forum|alt.badge.img+2
  • Participating Frequently
  • December 27, 2018

Teamwork :)