sql: how to convert datatype of column?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2016 03:05 PM
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2016 11:21 AM
@dan11
We don't support
number
in Spark SQL. Try using int
, double
, float
, and your query should be fine. To run SQL in a notebook, just prepend any cell with %sql.
%sql
select cast(myage as double) as my_integer_age from ages;

