Yeah - that’s expected - the
<p_key:int64>[row_num] is not the schema that aio_input returns, so you’d need to coerce or redimension the data before you can insert.
For starters, just try storing it into a brand new array without pre-creation. This will show you what shape aio creates:
$ iquery -anq "remove(attr_temp2)" #make sure it doesn't exist / pick a unique name
$ iquery -anq "store(aio_input('/tmp/pipe', 'num_attributes=1'), attr_temp2)"
$ iquery -aq "show(attr_temp2)"
To put the data into the shape you have would look something like this:
$ iquery -anq "
p_key, dcast(a0, int64(null))
The aio package does the multi-instance parsing inside the DB, and, in addition to that, the input data may come from multiple files or streams. So to disambiguate and for error tolerance it returns an array with all string attributes and 3 dimensions (source instance ID, destination instance ID and line number). It also adds a “error” attribute for error handling.
For more info, take another look at the aio doc (github link above). There are many additional examples and tutorials. This walkthrough is quite nice: http://rvernica.github.io/2016/05/load-data