Skip to content

Instantly share code, notes, and snippets.

@randyzwitch
Created July 14, 2014 14:57
Show Gist options
  • Save randyzwitch/10d3db9893cdfb026008 to your computer and use it in GitHub Desktop.
Save randyzwitch/10d3db9893cdfb026008 to your computer and use it in GitHub Desktop.
Looping over datasets in Julia, pulling sample
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "help()" to list help topics
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.3.0-prerelease+4028 (2014-07-02 23:42 UTC)
_/ |\__'_|_|_|\__'_| | Commit 2185bd1 (11 days old master)
|__/ | x86_64-w64-mingw32
julia> using ODBC
julia> ODBC.connect("Production hiveserver2", usr="", pwd="")
ODBC Connection Object
----------------------
Connection Data Source: Production hiveserver2
Production hiveserver2 Connection Number: 1
Contains resultset? No
julia> tables = query("show tables in db;");
elapsed time: 0.167028049 seconds
julia> for tbl in tables[:tab_name]
query("select * from db.$(tbl) limit 1000;"; output="C:\\data_dump\\$(tbl).tab", delim='\t')
end
julia>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment