Array Design Question


Here is the csv file data, the 24 hour temperature @ an airport for a day.


I create the schema like this to load this data.

CREATE EMPTY ARRAY hrly_temp_load
	airport : int64,
	ts : datetime,
	hr00 : double,
	hr01 : double,
	hr02 : double,
	hr03 : double,
	hr04 : double,
	hr05 : double,
	hr06 : double,
	hr07 : double,
	hr08 : double,
	hr09 : double,
	hr10 : double,
	hr11 : double,
	hr12 : double,
	hr13 : double,
	hr14 : double,
	hr15 : double,
	hr16 : double,
	hr17 : double,
	hr18 : double,
	hr19 : double,
	hr20 : double,
	hr22 : double,
	hr23 : double,
	hr24 : double
[ Line=0:*,1000,0 ]

I like to redimension this hrly_temp_load to hrly_temp which has 3 dimensions, airport, ts and hrs. What is the best way to do this?
I would like to know how to convert the attribute list hr[00-24] to a dimension.

I would like to redimension the above to the schema to the below

[code]CREATE EMPTY ARRAY hrly_temp
val : double

[ airport=0:,10000,0, ts(datetime)=,3650000,0, hrs:0:24,24,0 ][/code]

Thank you,


Hi Vijay,

Here’s a thought:

   build(<hrs:int64>[x=0:23,24,0], x)
  iif(hrs = 0, hr00, 
  iif(hrs = 1, hr01,
  iif(hrs = 2, hr02,

This is one of those cases where a cartesian product (cross) works unexpectedly well. Let me know if this works for you…


I was wondering how cross is going to be used and this is a good example. I re-organized the data in awk to loaded it. But I liked the technique.

Thank you,