How to obtain a string type data in a dataset with HDFql in JAVA?

0

I'm new in HDF5 and HDFql, I'm working in java and I have a .h5 file with several groups, inside each group I have different Datasets, some are floating arrays, which I get as follows. https://gyazo.com/c10100b327d20a2db8c13f2fd9ab7668

 Double[][] values = new Double[numRow][numCol];
 HDFql.variableRegister(values);
 HDFql.execute("SELECT FROM "+gName+"/"+dName+" INTO MEMORY "+HDFql.variableGetNumber(values));
 HDFql.variableUnregister(values);

The problem occurs when I have a dataset with a variable that is 1 row and 1 column and the type of data, is String. https://gyazo.com/2622693aee83d9eba5487a053ba9247c

I have tried to implement the following codes and I get the following error message

  String[] val = new String[10];
  HDFql.variableRegister(val);
  HDFql.execute("SELECT FROM "+gName+"/"+dName+" INTO MEMORY "+HDFql.variableGetNumber(val));
  HDFql.variableUnregister(val);

and

String val = "";
HDFql.variableRegister(val);
HDFql.execute("SELECT FROM "+gName+"/"+dName+" INTO MEMORY "+HDFql.variableGetNumber(val));
HDFql.variableUnregister(val);

the error shown by the console is:

A fatal error has been detected by the Java Runtime Environment:

EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000006da2f270, pid=42048, tid=0x00000000000089d4

JRE version: Java(TM) SE Runtime Environment (8.0_211-b12) (build 1.8.0_211-b12) Java VM: Java HotSpot(TM) 64-Bit Server VM (25.211-b12 mixed mode windows-amd64 compressed oops) Problematic frame: V [jvm.dll+0x27f270]

Failed to write core dump. Minidumps are not enabled by default on client versions of Windows

An error report file with more information is saved as: C:\Users\us\AppData\Local\Temp\hs_err_pid42048.log

If you would like to submit a bug report, please visit:
http://bugreport.java.com/bugreport/crash.jsp

Any help is welcome, thank you very much in advance

java
string
select
hdf5
hdfql
asked on Stack Overflow Jun 4, 2020 by JavierSO • edited Jun 6, 2020 by Muhammad Dyas Yaskur

3 Answers

0

Even if the dataset only has one element (in your case, 1 row x 1 col), you still need to declare the variable (that you register to store the data) as an array. In other words, declare and create variable val as follows:

String val[] = new String[1];

Additionally, please check section 5.2.51 in HDFql reference manual to know what type of variables you may register (with method variableRegister) in Java.

answered on Stack Overflow Jun 5, 2020 by SOG
0

Sorry for my delay in answering.

The problem persists, I found a way to access 1 Row x 1 Col variables. However, the problem seems to be another one.

I have a method that implements an HDFql call as follows. https://gyazo.com/c3bc1e4e568cb4277607fa21ea71445f

If I make 2 calls from the class constructor to the method https://gyazo.com/9dee4e0b9a0ea69e73089b2802dbdad9 Works correctly and I get as a result the two datasets that I have consulted. https://gyazo.com/40e4485408fe08e7cf9a1ad8baf97a9d https://gyazo.com/372fc6cb991992e82340325dfd0b548d

However, when I try to run the same method on a listener when a button is clicked. https://gyazo.com/928ee0b90e8b864fe6908b79e56da7a7 https://gyazo.com/f8c044e298208fa9f94c8be7bc5e1de3

An error occurs in Java, I have increased the memory heap to a maximum of 8Gb and I release all the variables of the HDFql once I finish the query, but the error persists. I don't understand why if the call is made from the constructor, even if it's several consecutive calls, it works and on the contrary, if a call is made from a method other than the constructor, the next error is returned.

* A fatal error has been detected by the Java Runtime Environment:

EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000054f6f1c2, pid=137068, tid=0x0000000000014d88

JRE version: Java(TM) SE Runtime Environment (8.0_211-b12) (build 1.8.0_211-b12) Java VM: Java HotSpot(TM) 64-Bit Server VM (25.211-b12 mixed mode windows-amd64 compressed oops) Problematic frame: V [jvm.dll+0x15f1c2]

Failed to write core dump. Minidumps are not enabled by default on client versions of Windows

An error report file with more information is saved as: C:\Users\Code\AppData\Local\Temp\hs_err_pid137068.log

If you would like to submit a bug report, please visit: http://bugreport.java.com/bugreport/crash.jsp The crash happened outside the Java Virtual Machine in native code. See the problematic frame for where to report the bug. *

answered on Stack Overflow Jun 30, 2020 by JavierSO • edited Jun 30, 2020 by JavierSO
0

I'm using the Vaadin framework for the development of a web application, I don't create any threads but I think this framework could be creating threads when the user interacts with the browser's components (buttons, comboBox, etc). I have tried to run the method from the constructor, which runs when you navigate to that view, the first time you navigate it works correctly, however, when you return to navigate or refresh the web page fails to access. It's like HDFql is caching or saving memory addresses from the previous access, and when you browse again or click a button certain variables will change their memory pointer and instead of using the new pointer, HDFql is trying to reuse the previous memory addresses.

Method: http://cpp.sh/8s5c3

Log: http://cpp.sh/3zgxa

answered on Stack Overflow Jul 1, 2020 by JavierSO

User contributions licensed under CC BY-SA 3.0