@@ -1629,7 +1629,7 @@ func TestSetRelations(t *testing.T) {
16291629	checkRoundTrip (t , expectedJSON , p )
16301630}
16311631
1632- func  TestEmptyVirtualTable (t  * testing.T ) {
1632+ func  TestColumnlessVirtualTable (t  * testing.T ) {
16331633	const  expectedJSON  =  `{ 
16341634		`  +  versionStruct  +  `, 
16351635		"relations": [ 
@@ -1647,24 +1647,7 @@ func TestEmptyVirtualTable(t *testing.T) {
16471647								"expressions": [ 
16481648									{}, 
16491649									{}, 
1650- 									{}, 
1651- 									{}, 
1652- 									{}, 
1653- 									{}, 
1654- 									{}, 
1655- 									{}, 
1656- 									{}, 
1657- 									{}, 
1658- 									{}, 
1659- 									{}, 
1660- 									{}, 
1661- 									{}, 
1662- 									{}, 
1663- 									{}, 
1664- 									{}, 
1665- 									{}, 
1666- 									{}, 
1667- 									{}									 
1650+ 									{} 
16681651								] 
16691652							} 
16701653						} 
@@ -1676,7 +1659,7 @@ func TestEmptyVirtualTable(t *testing.T) {
16761659
16771660	b  :=  plan .NewBuilderDefault ()
16781661
1679- 	virtual , err  :=  b .VirtualTable (nil , make ([]expr.StructLiteralValue , 20 )... )
1662+ 	virtual , err  :=  b .VirtualTable (nil , make ([]expr.StructLiteralValue , 3 )... )
16801663	require .NoError (t , err )
16811664
16821665	p , err  :=  b .Plan (virtual , []string {})
@@ -1685,6 +1668,45 @@ func TestEmptyVirtualTable(t *testing.T) {
16851668	checkRoundTrip (t , expectedJSON , p )
16861669}
16871670
1671+ func  TestEmptyVirtualTable (t  * testing.T ) {
1672+ 	const  expectedJSON  =  `{ 
1673+ 		`  +  versionStruct  +  `, 
1674+ 		"relations": [ 
1675+ 			{ 
1676+ 				"root": { 
1677+ 					"input": { 
1678+ 						"read": { 
1679+ 							"common": {"direct":{}}, 
1680+ 							"baseSchema": { 
1681+ 								"names": ["i"], 
1682+ 								"struct": { 
1683+ 									"types": [ 
1684+ 										{"i32": {"nullability": "NULLABILITY_REQUIRED"}} 
1685+ 									], 
1686+ 									"nullability": "NULLABILITY_REQUIRED" 
1687+ 								} 
1688+ 							}, 
1689+ 							"virtualTable": {} 
1690+ 						} 
1691+ 					}, 
1692+ 					"names": ["i"] 
1693+ 				} 
1694+ 			} 
1695+ 		] 
1696+ 	}` 
1697+ 
1698+ 	b  :=  plan .NewBuilderDefault ()
1699+ 
1700+ 	i32Type  :=  types.Int32Type {Nullability : types .NullabilityRequired }
1701+ 	virtual , err  :=  b .EmptyVirtualTable ([]string {"i" }, []types.Type {& i32Type })
1702+ 	require .NoError (t , err )
1703+ 
1704+ 	p , err  :=  b .Plan (virtual , []string {"i" })
1705+ 	require .NoError (t , err )
1706+ 
1707+ 	checkRoundTrip (t , expectedJSON , p )
1708+ }
1709+ 
16881710func  TestSetRelErrors (t  * testing.T ) {
16891711	b  :=  plan .NewBuilderDefault ()
16901712
0 commit comments