Created
July 14, 2014 14:57
-
-
Save randyzwitch/10d3db9893cdfb026008 to your computer and use it in GitHub Desktop.
Looping over datasets in Julia, pulling sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_ | |
_ _ _(_)_ | 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