CREATE FOREIGN TABLE Customer ( documentID string OPTIONS (UPDATABLE FALSE), ID string OPTIONS (NAMEINSOURCE '`test`.`ID`'), Name string OPTIONS (NAMEINSOURCE '`test`.`Name`'), type string OPTIONS (NAMEINSOURCE '`test`.`type`'), CONSTRAINT PK0 PRIMARY KEY(documentID) ) OPTIONS (NAMEINSOURCE '`test`', UPDATABLE TRUE, "teiid_couchbase:ISARRAYTABLE" 'false', "teiid_couchbase:NAMEDTYPEPAIR" '`type`:''Customer'''); CREATE FOREIGN TABLE Customer_SavedAddresses ( documentID string, Customer_SavedAddresses_idx integer, Customer_SavedAddresses string OPTIONS (NAMEINSOURCE '`test`.`SavedAddresses`[]'), FOREIGN KEY(documentID) REFERENCES Customer ) OPTIONS (NAMEINSOURCE '`test`.`SavedAddresses`[]', UPDATABLE TRUE, "teiid_couchbase:ISARRAYTABLE" 'true'); CREATE FOREIGN TABLE Oder ( documentID string OPTIONS (UPDATABLE FALSE), CreditCard_CVN integer OPTIONS (NAMEINSOURCE '`test`.`CreditCard`.`CVN`'), CreditCard_CardNumber string OPTIONS (NAMEINSOURCE '`test`.`CreditCard`.`CardNumber`'), CreditCard_Expiry string OPTIONS (NAMEINSOURCE '`test`.`CreditCard`.`Expiry`'), CreditCard_Type string OPTIONS (NAMEINSOURCE '`test`.`CreditCard`.`Type`'), CustomerID string OPTIONS (NAMEINSOURCE '`test`.`CustomerID`'), Name string OPTIONS (NAMEINSOURCE '`test`.`Name`'), type string OPTIONS (NAMEINSOURCE '`test`.`type`'), CONSTRAINT PK0 PRIMARY KEY(documentID) ) OPTIONS (NAMEINSOURCE '`test`', UPDATABLE TRUE, "teiid_couchbase:ISARRAYTABLE" 'false', "teiid_couchbase:NAMEDTYPEPAIR" '`type`:''Oder'''); CREATE FOREIGN TABLE Oder_Items ( documentID string, Oder_Items_idx integer, Oder_Items_ItemID integer OPTIONS (NAMEINSOURCE '`test`.`Items`[].`ItemID`'), Oder_Items_Quantity integer OPTIONS (NAMEINSOURCE '`test`.`Items`[].`Quantity`'), FOREIGN KEY(documentID) REFERENCES Oder ) OPTIONS (NAMEINSOURCE '`test`.`Items`[]', UPDATABLE TRUE, "teiid_couchbase:ISARRAYTABLE" 'true');