java.lang.ClassCastException: water.rapids.ValStr cannot be cast to water.rapids.ValNum 06-15 13:56:53.300 172.16.2.16:54321 1974 # Session INFO: Method: POST , URI: /99/Rapids, route: /99/Rapids, parms: {ast=(= !py73f15b62-101e-4936-9401-a2ff66a8192d (+ (year '$04ff17000000ffffffff$nfs://Users/anqi_fu/Documents/workspace/h2o-3/smalldata/chicago/chicagoCrimes10k.csv.zip' ) #1900 ))}

JIRA | Anqi Fu | 1 year ago
  1. 0

    I try to run the following code for Chicago crimes demo and get a class cast exception in Rapids, cannot cast ValStr to ValNum. It occurs even if I comment out the WeekDay and Season column creation lines. The error comes up when the Python script hits crimes.describe(). What's worse is that after the error, I cannot even re-import the crimes data; I get a parse AIOOBE and have to restart my iPython notebook. crimes_path = h2o.locate("smalldata/chicago/chicagoCrimes10k.csv.zip") crimes = h2o.import_frame(path=crimes_path) crimes.describe() def refine_date_col(data, col, pattern): data[col] = data[col].as_date(pattern) data["Day"] = data[col].day() data["Month"] = data[col].month() + 1 # Since H2O indexes from 0 data["Year"] = data[col].year() + 1900 # Start of epoch is 1900 data["WeekNum"] = data[col].week() data["WeekDay"] = data[col].dayOfWeek() data["HourOfDay"] = data[col].hour() # Create weekend and season cols # Spring = Mar, Apr, May. Summer = Jun, Jul, Aug. Autumn = Sep, Oct. Winter = Nov, Dec, Jan, Feb. # data["Weekend"] = [1 if x in ("Sun", "Sat") else 0 for x in data["WeekDay"]] data["Weekend"] = h2o.ifelse(data["WeekDay"] == "Sun" or data["WeekDay"] == "Sat", 1, 0)[0] data["Season"] = data["Month"].cut([0, 2, 5, 7, 10, 12], ["Winter", "Spring", "Summer", "Autumn", "Winter"]) refine_date_col(crimes, "Date", "%m/%d/%Y %I:%M:%S %p") crimes = crimes.drop("Date") crimes.describe() java.lang.ClassCastException: water.rapids.ValStr cannot be cast to water.rapids.ValNum 06-15 13:56:53.300 172.16.2.16:54321 1974 # Session INFO: Method: POST , URI: /99/Rapids, route: /99/Rapids, parms: {ast=(= !py73f15b62-101e-4936-9401-a2ff66a8192d (+ (year '$04ff17000000ffffffff$nfs://Users/anqi_fu/Documents/workspace/h2o-3/smalldata/chicago/chicagoCrimes10k.csv.zip' ) #1900 ))} at water.rapids.Env.peekDbl(Env.java:194) 06-15 13:56:53.303 172.16.2.16:54321 1974 # Session ERRR: java.lang.ClassCastException: water.rapids.ValStr cannot be cast to water.rapids.ValNum at water.rapids.ASTTimeOp.apply(ASTOp.java:1062) 06-15 13:56:53.304 172.16.2.16:54321 1974 # Session WARN: Caught exception: water.rapids.ValStr cannot be cast to water.rapids.ValNum; Stacktrace: [water.api.RapidsHandler.exec(RapidsHandler.java:132), sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method), sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57), sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43), java.lang.reflect.Method.invoke(Method.java:606), water.api.Handler.handle(Handler.java:56), water.api.RequestServer.handle(RequestServer.java:677), water.api.RequestServer.serve(RequestServer.java:614), water.NanoHTTPD$HTTPSession.run(NanoHTTPD.java:438), java.lang.Thread.run(Thread.java:745)] at water.rapids.AST.treeWalk(AST.java:49) at water.rapids.AST.treeWalk(AST.java:43) at water.rapids.AST.treeWalk(AST.java:83) at water.rapids.Exec.exec(Exec.java:68) at water.api.RapidsHandler.exec(RapidsHandler.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at water.api.Handler.handle(Handler.java:56) at water.api.RequestServer.handle(RequestServer.java:677) at water.api.RequestServer.serve(RequestServer.java:614) at water.NanoHTTPD$HTTPSession.run(NanoHTTPD.java:438) at java.lang.Thread.run(Thread.java:745)

    JIRA | 1 year ago | Anqi Fu
    java.lang.ClassCastException: water.rapids.ValStr cannot be cast to water.rapids.ValNum 06-15 13:56:53.300 172.16.2.16:54321 1974 # Session INFO: Method: POST , URI: /99/Rapids, route: /99/Rapids, parms: {ast=(= !py73f15b62-101e-4936-9401-a2ff66a8192d (+ (year '$04ff17000000ffffffff$nfs://Users/anqi_fu/Documents/workspace/h2o-3/smalldata/chicago/chicagoCrimes10k.csv.zip' ) #1900 ))}
  2. 0

    I try to run the following code for Chicago crimes demo and get a class cast exception in Rapids, cannot cast ValStr to ValNum. It occurs even if I comment out the WeekDay and Season column creation lines. The error comes up when the Python script hits crimes.describe(). What's worse is that after the error, I cannot even re-import the crimes data; I get a parse AIOOBE and have to restart my iPython notebook. crimes_path = h2o.locate("smalldata/chicago/chicagoCrimes10k.csv.zip") crimes = h2o.import_frame(path=crimes_path) crimes.describe() def refine_date_col(data, col, pattern): data[col] = data[col].as_date(pattern) data["Day"] = data[col].day() data["Month"] = data[col].month() + 1 # Since H2O indexes from 0 data["Year"] = data[col].year() + 1900 # Start of epoch is 1900 data["WeekNum"] = data[col].week() data["WeekDay"] = data[col].dayOfWeek() data["HourOfDay"] = data[col].hour() # Create weekend and season cols # Spring = Mar, Apr, May. Summer = Jun, Jul, Aug. Autumn = Sep, Oct. Winter = Nov, Dec, Jan, Feb. # data["Weekend"] = [1 if x in ("Sun", "Sat") else 0 for x in data["WeekDay"]] data["Weekend"] = h2o.ifelse(data["WeekDay"] == "Sun" or data["WeekDay"] == "Sat", 1, 0)[0] data["Season"] = data["Month"].cut([0, 2, 5, 7, 10, 12], ["Winter", "Spring", "Summer", "Autumn", "Winter"]) refine_date_col(crimes, "Date", "%m/%d/%Y %I:%M:%S %p") crimes = crimes.drop("Date") crimes.describe() java.lang.ClassCastException: water.rapids.ValStr cannot be cast to water.rapids.ValNum 06-15 13:56:53.300 172.16.2.16:54321 1974 # Session INFO: Method: POST , URI: /99/Rapids, route: /99/Rapids, parms: {ast=(= !py73f15b62-101e-4936-9401-a2ff66a8192d (+ (year '$04ff17000000ffffffff$nfs://Users/anqi_fu/Documents/workspace/h2o-3/smalldata/chicago/chicagoCrimes10k.csv.zip' ) #1900 ))} at water.rapids.Env.peekDbl(Env.java:194) 06-15 13:56:53.303 172.16.2.16:54321 1974 # Session ERRR: java.lang.ClassCastException: water.rapids.ValStr cannot be cast to water.rapids.ValNum at water.rapids.ASTTimeOp.apply(ASTOp.java:1062) 06-15 13:56:53.304 172.16.2.16:54321 1974 # Session WARN: Caught exception: water.rapids.ValStr cannot be cast to water.rapids.ValNum; Stacktrace: [water.api.RapidsHandler.exec(RapidsHandler.java:132), sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method), sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57), sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43), java.lang.reflect.Method.invoke(Method.java:606), water.api.Handler.handle(Handler.java:56), water.api.RequestServer.handle(RequestServer.java:677), water.api.RequestServer.serve(RequestServer.java:614), water.NanoHTTPD$HTTPSession.run(NanoHTTPD.java:438), java.lang.Thread.run(Thread.java:745)] at water.rapids.AST.treeWalk(AST.java:49) at water.rapids.AST.treeWalk(AST.java:43) at water.rapids.AST.treeWalk(AST.java:83) at water.rapids.Exec.exec(Exec.java:68) at water.api.RapidsHandler.exec(RapidsHandler.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at water.api.Handler.handle(Handler.java:56) at water.api.RequestServer.handle(RequestServer.java:677) at water.api.RequestServer.serve(RequestServer.java:614) at water.NanoHTTPD$HTTPSession.run(NanoHTTPD.java:438) at java.lang.Thread.run(Thread.java:745)

    JIRA | 1 year ago | Anqi Fu
    java.lang.ClassCastException: water.rapids.ValStr cannot be cast to water.rapids.ValNum 06-15 13:56:53.300 172.16.2.16:54321 1974 # Session INFO: Method: POST , URI: /99/Rapids, route: /99/Rapids, parms: {ast=(= !py73f15b62-101e-4936-9401-a2ff66a8192d (+ (year '$04ff17000000ffffffff$nfs://Users/anqi_fu/Documents/workspace/h2o-3/smalldata/chicago/chicagoCrimes10k.csv.zip' ) #1900 ))}
  3. 0

    I try to run the following code for Chicago crimes demo and get a class cast exception in Rapids, cannot cast ValStr to ValNum. It occurs even if I comment out the WeekDay and Season column creation lines. The error comes up when the Python script hits crimes.describe(). What's worse is that after the error, I cannot even re-import the crimes data; I get a parse AIOOBE and have to restart my iPython notebook. crimes_path = h2o.locate("smalldata/chicago/chicagoCrimes10k.csv.zip") crimes = h2o.import_frame(path=crimes_path) crimes.describe() def refine_date_col(data, col, pattern): data[col] = data[col].as_date(pattern) data["Day"] = data[col].day() data["Month"] = data[col].month() + 1 # Since H2O indexes from 0 data["Year"] = data[col].year() + 1900 # Start of epoch is 1900 data["WeekNum"] = data[col].week() data["WeekDay"] = data[col].dayOfWeek() data["HourOfDay"] = data[col].hour() # Create weekend and season cols # Spring = Mar, Apr, May. Summer = Jun, Jul, Aug. Autumn = Sep, Oct. Winter = Nov, Dec, Jan, Feb. # data["Weekend"] = [1 if x in ("Sun", "Sat") else 0 for x in data["WeekDay"]] data["Weekend"] = h2o.ifelse(data["WeekDay"] == "Sun" or data["WeekDay"] == "Sat", 1, 0)[0] data["Season"] = data["Month"].cut([0, 2, 5, 7, 10, 12], ["Winter", "Spring", "Summer", "Autumn", "Winter"]) refine_date_col(crimes, "Date", "%m/%d/%Y %I:%M:%S %p") crimes = crimes.drop("Date") crimes.describe() java.lang.ClassCastException: water.rapids.ValStr cannot be cast to water.rapids.ValNum 06-15 13:56:53.300 172.16.2.16:54321 1974 # Session INFO: Method: POST , URI: /99/Rapids, route: /99/Rapids, parms: {ast=(= !py73f15b62-101e-4936-9401-a2ff66a8192d (+ (year '$04ff17000000ffffffff$nfs://Users/anqi_fu/Documents/workspace/h2o-3/smalldata/chicago/chicagoCrimes10k.csv.zip' ) #1900 ))} at water.rapids.Env.peekDbl(Env.java:194) 06-15 13:56:53.303 172.16.2.16:54321 1974 # Session ERRR: java.lang.ClassCastException: water.rapids.ValStr cannot be cast to water.rapids.ValNum at water.rapids.ASTTimeOp.apply(ASTOp.java:1062) 06-15 13:56:53.304 172.16.2.16:54321 1974 # Session WARN: Caught exception: water.rapids.ValStr cannot be cast to water.rapids.ValNum; Stacktrace: [water.api.RapidsHandler.exec(RapidsHandler.java:132), sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method), sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57), sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43), java.lang.reflect.Method.invoke(Method.java:606), water.api.Handler.handle(Handler.java:56), water.api.RequestServer.handle(RequestServer.java:677), water.api.RequestServer.serve(RequestServer.java:614), water.NanoHTTPD$HTTPSession.run(NanoHTTPD.java:438), java.lang.Thread.run(Thread.java:745)] at water.rapids.AST.treeWalk(AST.java:49) at water.rapids.AST.treeWalk(AST.java:43) at water.rapids.AST.treeWalk(AST.java:83) at water.rapids.Exec.exec(Exec.java:68) at water.api.RapidsHandler.exec(RapidsHandler.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at water.api.Handler.handle(Handler.java:56) at water.api.RequestServer.handle(RequestServer.java:677) at water.api.RequestServer.serve(RequestServer.java:614) at water.NanoHTTPD$HTTPSession.run(NanoHTTPD.java:438) at java.lang.Thread.run(Thread.java:745)

    JIRA | 1 year ago | Anqi Fu
    java.lang.ClassCastException: water.rapids.ValStr cannot be cast to water.rapids.ValNum
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ClassCastException

      water.rapids.ValStr cannot be cast to water.rapids.ValNum 06-15 13:56:53.300 172.16.2.16:54321 1974 # Session INFO: Method: POST , URI: /99/Rapids, route: /99/Rapids, parms: {ast=(= !py73f15b62-101e-4936-9401-a2ff66a8192d (+ (year '$04ff17000000ffffffff$nfs://Users/anqi_fu/Documents/workspace/h2o-3/smalldata/chicago/chicagoCrimes10k.csv.zip' ) #1900 ))}

      at water.rapids.Env.peekDbl()
    2. water.rapids
      Env.peekDbl
      1. water.rapids.Env.peekDbl(Env.java:194)
      1 frame