Why can't i load from a txt file?


#1

AQL% create array A<a:int32>[i=0:4,2,0];
Query was executed successfully
AQL%
AQL%
AQL% load(A,‘1.txt’);
Error query id: 1309000098
Error message: Error during AQL parsing: syntax error, unexpected ‘(’, expecting LIBRARY or identifier
Error code:40 ( Parser error )
Affected query is: load(A,‘1.txt’)
Error position line 1…1 column 5…6
AQL%
AQL%

administrator@ubuntu:~/test$ cat 1.txt
[(1),(2)];
[(3),(4)]

another example:
AQL% create array build_example<A:int32>[X=0:4,5,0, Y=0:4,5,0];
Query was executed successfully
AQL%
AQL%
AQL% build(build_example,iif(X=Y,1,0));
Error query id: 1309091657
Error message: Error during AQL parsing: syntax error, unexpected identifier
Error code:40 ( Parser error )
Affected query is: build(build_example,iif(X=Y,1,0))
Error position line 1…1 column 1…6
AQL%
AQL%


#2

Hi.

SciDB can work with 2 languages AQL and AFL. AFL is low level functional query language and AQL is high-level declarative wrapper around AFL.

As you see, you working in AQL mode (AQL% at begin of iquery shell prompt), but trying execute AFL command. You must switch to AFL before with “set lang afl;” command. You can find more about iquery/AFL/AQL syntax in this forum post: viewtopic.php?f=11&t=331


#3

AQL% create array A<a:int32>[i=0:3,2,0];
Query was executed successfully
AQL%
AQL%
AQL% load A from ‘1.txt’;
[]
AQL% select * from A;
[]

AQL% LOAD A FROM ‘1.txt’;
[]
AQL%
AQL%
AQL% select * from A;
[]

It still doesnt work, can you help me?


#4

Note, this is not client-side loading, this is server-side loading. I think here server not found your file and loading nothing. Where you file located? Currently path for loading starting from scidb binary directory, so you can use path relative to bin dir or absolute path to data. Also note error will not be produced even if file not found during load, because during loading in distributed environment not all nodes can have file, so loading from not existing file is not error.