osemeister.blogg.se

Tableplus redis
Tableplus redis










tableplus redis tableplus redis

HGETALL product:10003 Use DataFrames to automatically map your tables to Redis data structures Select * from Product where price < 300 Redis: Select * from Products where id = 10200 Redis: HMSET product:10200 name ZXYW desc “Description for ZXYW” price 300 Insert into Products (id, name, description, price) Below are some examples of SQL and Redis equivalent commands: #TABLEPLUS VIEW SQL PRINT CODE# Now, if you want to maintain the SQL interface in your solutions and only change the underlying data store to Redis to make it faster, then you can do so by using Apache Spark and Spark-Redis library. Spark-Redis library allows you to use the DataFrame APIs to store and access Redis data. In other words, you can insert, update and query data using SQL commands, but the data is internally mapped to Redis data structures.įigure 2.

tableplus redis

The stack for Spark SQL and Redisįirst, you need to download spark-redis and build the library to get the jar file. For example, with spark-redis 2.3.1, you get spark-redis-2.3.1-SNAPSHOT-jar-with- dependencies.jar. You then next have to make sure that you have your Redis instance running. In our example, we’ll run Redis on localhost and the default port 6379. SparkSession You can also run your queries on Apache Spark engine. redis options (table 'product')") Here’s an example of how you can do this: $ spark-shell -jars spark-redis-2.3.1-SNAPSHOT-jar-with-dependencies.jar scala> import. Scala> val results = sql("select * from products") Scala> sql("insert into products values = ('10200','ZXYW','Description of ZXYW', 300)") Scala> sql("create table if not exists products(id string, name string, description string, price int) using.












Tableplus redis