Coder Social home page Coder Social logo

bernhardschlegel / sql-dumper Goto Github PK

View Code? Open in Web Editor NEW
5.0 6.0 6.0 6.56 MB

Dumps the result of SQL to an CSV on the filesystem. Queries can be split into subqueries, reducing the complexity on the server side.

License: MIT License

HTML 0.23% Java 99.77%
sql sql-dumper csv database dump subqueries sql-script sql-files jar

sql-dumper's Issues

Test with how many rows?

Hi,

Can you please let us know, with how many millions rows you have tested this cmd to export? I need to export 3 Million data, how much time it will take to export using the SQL-dumper?

Thanks,
Chandru

Semi colon ; in query

Problem

sqldump.etl.Query replacing ; with empty string while loading queries from file. (see line 60)

This will case the problem for some case for example below query

with temp as ( SELECT 'value1;value2;value3' text FROM  dual )
select regexp_substr(t.text, '[^;]+', 1, levels.column_value) as text from temp t,
	table(cast(multiset(select level from dual connect by level <= length (regexp_replace(t.text, '[^;]+')) + 1) as sys.OdciNumberList)) levels

Possible solution:

  1. Should not replace the ; (ask in documentation/readme to not put semi-colon in file)
  2. Remove only the last ; from query (in the end of file)

memory issues

Does not work with large tables.

19.01.2018 14:08:07 [INF]: converting data to CSV (one dot corresponds with 50k lines).......Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded
at java.util.Arrays.copyOfRange(Arrays.java:2694)
at java.lang.String.(String.java:203)
at java.lang.StringBuilder.toString(StringBuilder.java:405)
at sqldump.etl.Dump.toFile(Dump.java:93)
at sqldump.etl.Query.executeQuery(Query.java:221)
at sqldump.etl.Query.getDataFromSQLFile(Query.java:62)
at sqldump.SQLDump.run(SQLDump.java:89)
at sqldump.Main.main(Main.java:7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.