Getting error with Cast to a specific data type field in datamodel

Hi All,
I had imported the my data which is in csv file into metabse by using csv driver. In my data I have two date fields, when I am changing the Cast to a specific data type into don't cast in datamodel I am able to get the data , if I change the Cast to a specific data type into something else I am getting error message saying that There was a problem with your question and I am unable to see my data .
How I solve this problem , Please help me out.
Thanks...

Hi @NARESHKUMAR
Post "Diagnostic Info" from Admin > Troubleshooting, and which version of CSV driver you're using.
Check the logs for detailed errors in Admin > Troubleshooting > Logs.
What exactly is your data of the date column? And which casting are you using?

Hi @flamber
here I'm posting the Diagnostic Info
and I'm using csv v1.3.1 and I'm trying to cast orderdate into ISO-Date type
{
"browser-info": {
"language": "en-US",
"platform": "Win32",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "Java(TM) SE Runtime Environment",
"java.runtime.version": "18.0.2.1+1-1",
"java.vendor": "Oracle Corporation",
"java.vendor.url": "https://java.oracle.com/",
"java.version": "18.0.2.1",
"java.vm.name": "Java HotSpot(TM) 64-Bit Server VM",
"java.vm.version": "18.0.2.1+1-1",
"os.name": "Windows 10",
"os.version": "10.0",
"user.language": "en",
"user.timezone": "Asia/Calcutta"
},
"metabase-info": {
"databases": [
"h2",
"csv"
],
"hosting-env": "unknown",
"application-database": "h2",
"application-database-details": {
"database": {
"name": "H2",
"version": "1.4.197 (2018-03-18)"
},
"jdbc-driver": {
"name": "H2 JDBC Driver",
"version": "1.4.197 (2018-03-18)"
}
},
"run-mode": "prod",
"version": {
"date": "2022-09-29",
"tag": "v0.44.4",
"branch": "release-x.44.x",
"hash": "382d728"
},
"settings": {
"report-timezone": null
}
}
}

@NARESHKUMAR You need to include your CSV data, and exactly which casting option you are using. If you cannot provide this, then I cannot help you.

You should use Java 11 https://www.metabase.com/docs/latest/installation-and-operation/java-versions and migrate away from H2 if you're using Metabase in production https://www.metabase.com/docs/latest/installation-and-operation/migrating-from-h2

Hi @flamber
here I'm posting the Diagnostic Info and I'm using csv v1.3.1 and I'm trying to cast date into ISO-Date type. If I have cast date field into don't cast option then I can able to view the data in the table and I can't aggregation the data (i.e I can't find the option like by week,by month, by year in summarize ). If I have cast date field into ISO-8601 date then I can able to find the option like by week, by month, by year but I am getting the error like Syntax error: Encountered " "AS" "AS "" at line 2, column 45. Was expecting: ")" ... and I can't find the data in the tables.
And I'm posting the Screenshots for the same.


{
"browser-info": {
"language": "en-US",
"platform": "Win32",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "Java(TM) SE Runtime Environment",
"java.runtime.version": "18.0.2.1+1-1",
"java.vendor": "Oracle Corporation",
"java.vendor.url": "https://java.oracle.com/",
"java.version": "18.0.2.1",
"java.vm.name": "Java HotSpot(TM) 64-Bit Server VM",
"java.vm.version": "18.0.2.1+1-1",
"os.name": "Windows 10",
"os.version": "10.0",
"user.language": "en",
"user.timezone": "Asia/Calcutta"
},
"metabase-info": {
"databases": [
"h2",
"csv"
],
"hosting-env": "unknown",
"application-database": "h2",
"application-database-details": {
"database": {
"name": "H2",
"version": "1.4.197 (2018-03-18)"
},
"jdbc-driver": {
"name": "H2 JDBC Driver",
"version": "1.4.197 (2018-03-18)"
}
},
"run-mode": "prod",
"version": {
"date": "2022-09-29",
"tag": "v0.44.4",
"branch": "release-x.44.x",
"hash": "382d728"
},
"settings": {
"report-timezone": null
}
}
}