Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClassCastException: Incorrect type double[] #737

Open
HuifangYeo opened this issue Jan 31, 2023 · 2 comments
Open

ClassCastException: Incorrect type double[] #737

HuifangYeo opened this issue Jan 31, 2023 · 2 comments
Labels
🐛 bug unexpected or wrong behavior

Comments

@HuifangYeo
Copy link
Contributor

Steps to reproduce

In my environment, I have the plugin atoti-directquery-bigquery installed.

I was able to successfully create a table with read_csv for the dataset _IRDelta.csv:

irDeltaTbl = session.read_csv(
    "data/_IRDelta.csv",
    table_name="IR Delta",
    keys=["AsOfDate", "TradeID", "RiskFactor", "RiskFactorType", "RiskMeasure"],
    array_separator=";",
)

However, with another dataset - sensitivities_4.csv, I was able to create the table but no data loaded:

sensitivities_tbl = session.read_csv(
    "data/sensitivities_4.csv",
    table_name="Sensitivities",
    keys=["TradeId", "AsOfDate", "BookId"],
    array_separator=";",
)

The following exception was thrown in the log:

java.lang.ClassCastException: Incorrect type double[] for tuple with value [D@70eefc4a for lookup in dictionary of type NullableDictionary. Exception in store: Sensitivities, field: PnlVector, for tuple: [2019404784, 07/10/2019, 1426, 610.28, 10.09, 58.73, 61.03, -2.29, 3893.77, -25.95, 32.0, -229.88, [D@70eefc4a].
	at com.qfs.store.transaction.impl.TransactionManager.transformToFullRecords(TransactionManager.java:1464) ~[atoti-directquery-bigquery.jar:na]
	at com.qfs.store.transaction.impl.TransactionManager.addAll(TransactionManager.java:1312) ~[atoti-directquery-bigquery.jar:na]
	at com.qfs.store.transaction.ITransactionalWriter.addAll(ITransactionalWriter.java:56) ~[atoti-directquery-bigquery.jar:na]
	at com.qfs.store.transaction.impl.AlterableTransactionManager.addAll(AlterableTransactionManager.java:287) ~[atoti-directquery-bigquery.jar:na]
	at com.qfs.source.impl.TuplePublisher.publish(TuplePublisher.java:115) ~[atoti-directquery-bigquery.jar:na]
	at com.qfs.source.impl.StoreMessage.append(StoreMessage.java:115) ~[atoti-directquery-bigquery.jar:na]
	at com.qfs.msg.csv.impl.Parser.parse(Parser.java:236) ~[atoti-aws.jar:na]
	at com.qfs.msg.csv.impl.ParserTask.parseIteration(ParserTask.java:404) ~[atoti-aws.jar:na]
	at com.qfs.msg.csv.impl.ParserTask.call(ParserTask.java:255) ~[atoti-aws.jar:na]
	at com.qfs.msg.csv.impl.ParserTask.call(ParserTask.java:46) ~[atoti-aws.jar:na]
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[na:na]
	at java.base/java.lang.Thread.run(Unknown Source) ~[na:na]
	at com.qfs.msg.csv.impl.ParserThread.run(ParserThread.java:57) ~[atoti-aws.jar:na]
	Suppressed: java.lang.ClassCastException: null

sensitivities_4.csv
_IRDelta.csv
server.log

Environment

  • atoti: 0.7.2
  • Python: 3.10.0
  • Operating system: win32
@HuifangYeo HuifangYeo added the 🐛 bug unexpected or wrong behavior label Jan 31, 2023
@rcolle
Copy link
Member

rcolle commented Jan 31, 2023

Do you have the same issue when the atoti-directquery-bigquery plugin is not installed?

@HuifangYeo
Copy link
Contributor Author

Hi @rcolle,

I discovered that this problem only happens after I delete the table and re-execute the cell within the same session.
Please see the GIF below:

del_tables

training.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug unexpected or wrong behavior
Projects
None yet
Development

No branches or pull requests

2 participants