C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
Sqoop WhereYou can place restrictions on data imported by using "where" clause. Let's import cityByCountry table where state ( 6th column is restricted to "Alaska"). The Sqoop statement is written below sqoop import \ --connect "jdbc:mysql://localhost/training" \ --username training -P \ --table cityByCountry \ --target-dir /user/where_clause \ --where "state = 'Alaska'" \ -m 1 Output is shown below Let's list all databases present on a mysql server using a "list-databases" tool. Note : for more information on list-databases, type "$ sqoop help list-databases".$ sqoop list-databases --connect "jdbc:mysql://localhost" --username cloudera --password cloudera Similarly for listing tables $ sqoop list-tables --connect "jdbc:mysql://localhost/training" --username cloudera -P
Next TopicSqoop Export
|