Skip to content

hydromatic/look-data-hsqldb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Maven Central javadoc

look-data-hsqldb

'The Look' data set in hsqldb format

This project contains the 'The Look' data set as an embedded HSQLDB database.

It originated as an internal test data set for the Looker business intelligence (BI) tool, modeling a fictitious fashion business.

Schema

The Look's schema consists of 5 tables:

Table Row count
all_types 1
nested_and_repeated 2
orders 4,066
order_items 12,142
users 85

Its size is about 970 KB uncompressed, 160 KB compressed.

Using the data set

The data set is packaged as a jar file that is published to Maven Central as a Maven artifact. To use the data in your Java application, add the artifact to your project's dependencies:

<dependency>
  <groupId>net.hydromatic</groupId>
  <artifactId>look-data-hsqldb</artifactId>
  <version>0.1</version>
</dependency>

Now you can connect using Java code:

import java.sql.Connection;
import java.sql.Statement;
import java.sql.ResultSet;

final String url = "jdbc:hsqldb:res:look";
final String sql = "select \"id\", \"name\" from \"users\"";
try (Connection c = DriverManager.getConnection(url, "looker", "looker");
    Statement s = c.createStatement();
    ResultSet r = s.executeQuery(sql)) {
  while (r.next()) {
    System.out.println(r.getInt(1) + ":" + r.getString(2));
  }
}

For your convenience, the net.hydromatic.look.data.hsqldb.LookHsqldb class has public constants:

You can also connect using a JDBC interface such as sqlline. Make sure that look-data-hsqldb.jar is on the class path, and start sqlline:

$ ./sqlline
sqlline version 1.12.0
sqlline> !connect jdbc:hsqldb:res:look sa ""
0: jdbc:hsqldb:res:look> select count(*) from "look"."orders";
+------+
|  C1  |
+------+
| 4066 |
+------+
1 row selected (0.004 seconds)
0: jdbc:hsqldb:res:look> !quit

If you use username and password "looker" and "looker", the default schema is "look", so you can omit the table prefix, if you wish:

$ ./sqlline
sqlline version 1.12.0
sqlline> !connect jdbc:hsqldb:res:look looker looker
0: jdbc:hsqldb:res:look> select count(*) from "users";
+------+
|  C1  |
+------+
| 4066 |
+------+
1 row selected (0.004 seconds)
0: jdbc:hsqldb:res:look> !quit

Get look-data-hsqldb

From Maven

Get look-data-hsqldb from Maven Central:

<dependency>
  <groupId>net.hydromatic</groupId>
  <artifactId>look-data-hsqldb</artifactId>
  <version>0.1</version>
</dependency>

Download and build

Java version 8 or higher.

$ git clone git://github.com/hydromatic/look-data-hsqldb.git
$ cd look-data-hsqldb
$ ./mvnw install

On Windows, the last line is

> mvnw install

See also

Similar data sets:

More information

About

'The Look' data set for hsqldb

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages