• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1--
2-- Copyright 2021 The Android Open Source Project
3--
4-- Licensed under the Apache License, Version 2.0 (the "License");
5-- you may not use this file except in compliance with the License.
6-- You may obtain a copy of the License at
7--
8--     https://www.apache.org/licenses/LICENSE-2.0
9--
10-- Unless required by applicable law or agreed to in writing, software
11-- distributed under the License is distributed on an "AS IS" BASIS,
12-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-- See the License for the specific language governing permissions and
14-- limitations under the License.
15--
16create table t1(
17  ts BIG INT,
18  dur BIG INT,
19  part BIG INT,
20  a BIG INT,
21  PRIMARY KEY (part, ts)
22) without rowid;
23
24create table t2(
25  ts BIG INT,
26  dur BIG INT,
27  b BIG INT,
28  PRIMARY KEY (ts)
29) without rowid;
30
31-- Add some rows to t1.
32INSERT INTO t1(ts, dur, part, a)
33VALUES
34(100, 400, 1, 10),
35(500, 100, 1, 11),
36(500, 50, 2, 12),
37(600, 100, 3, 13);
38
39-- Add some rows to t2.
40INSERT INTO t2(ts, dur, b)
41VALUES
42(50, 100, 14),
43(550, 50, 15),
44(600, 50, 16),
45(900, 500, 17);
46
47create virtual table sp using span_outer_join(t1 PARTITIONED part, t2);
48
49select * from sp;
50