41.insert.mql 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. insert into /test/foo (v_varchar, v_text, v_string, v_chars, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob, vtime)
  2. values ('1', '1', '1', 'x', 1, 1, 1.1234567890123456, 1.1234567890123457, true, ["a"], ["a"], {"a":1.1}, "hello", "1970-01-01 00:00:00.000001" )
  3. ;
  4. insert into /test/foo (v_varchar, v_text, v_string, v_chars, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob, vtime)
  5. values ('1', '1', '1', 'a', 1, 1, 1.1234567890123456, 1.1234567890123457, true, ["a"], ["a"], {"a":1.1}, "hello", "0001-01-01 00:00:00.000000" )
  6. ;
  7. update /test/foo set vtime='0001-01-03 00:00:00.000000' where v_varchar='1'
  8. ;
  9. update /test/foo set vtime=? where v_varchar='1'
  10. /**
  11. params('1900-12-31 23:59:59.000001')
  12. **/
  13. ;
  14. insert into /test/foo (v_varchar, v_text, v_string, v_chars, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob)
  15. values ('2', '2', '2', 'b', 2, 2, 2.1, 2.1, false, ["a"], ["a"], {"a":1.1}, "hello" )
  16. ;
  17. insert into /test/foo (v_varchar, v_text, v_string, v_chars, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob)
  18. values ('3', '2', '2', 'b', 2, 2, 2.2, 2.2, true, ["a"], ["a"], {"a":1.1}, "hello" )
  19. ;
  20. insert into /test/foo (v_varchar, v_text, v_string, v_chars, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob)
  21. values ('4', '3', '3', 'c', 3, 3, 3.1, 3.1, false, ["a"], ["a"], {"a":1.1}, "hello" )
  22. ;
  23. insert into /test/foo (v_varchar, v_text, v_string, v_chars, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob)
  24. values ('5', '3', '3', 'c', 3, 3, 3.2, 3.3, false, ["a"], ["a"], {"a":1.1}, "hello" )
  25. ;
  26. insert into /test/foo (v_varchar, v_text, v_string, v_chars, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob)
  27. values ('6', '3', '3', 'c', 3, 3, 3.3, 3.5, false, ["a"], ["a"], {"a":1.1}, "hello" )
  28. ;
  29. insert into /test/foo (v_varchar, v_text, v_string, v_chars, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob)
  30. values ('7', '4', '4', 'd', 4, 4, 3.1, 3.1, false, ["a"], ["a"], {"a":1.1}, "hello" )
  31. ;
  32. insert into /test/foo (v_varchar, v_text, v_string, v_chars, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob)
  33. values ('8', '4', '4', 'd', 4, 4, 3.2, 3.3, false, ["a"], ["a"], {"a":1.1}, "hello" )
  34. ;
  35. insert into /test/foo (v_varchar, v_text, v_string, v_chars, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob)
  36. values ('9', '4', '4', 'd', 4, 4, 3.3, 3.5, false, ["a"], ["a"], {"a":1.1}, "hello" )
  37. ;
  38. insert into /test/foo (v_varchar, v_text, v_string, v_chars, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob)
  39. values ('a', '4', '4', 'd', 4, 4, 3.4, 3.7, false, ["a"], ["a"], {"a":1.1}, "hello" )
  40. ;
  41. /**
  42. sleep(2s)
  43. **/
  44. ;
  45. select * from /test/foo refresh
  46. /**
  47. output()
  48. count(10)
  49. **/
  50. ;
  51. -- 这个如果有错,重启一下cassandra就好了
  52. -- If error occurs with this, just restart Cassandra
  53. select * from /test/foo where v_float >= 1.1 or v_float <= 1.1
  54. /**
  55. output()
  56. count(10)
  57. **/
  58. ;
  59. select * from /test/foo where v_float=1.1234567890123457
  60. /**
  61. output()
  62. count(1)
  63. **/
  64. ;