Skip to content

Commit ac3f9ef

Browse files
committed
test: fix external table ObjectType for Cloudberry, GPDB 7+
1 parent bfabd5e commit ac3f9ef

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

meta/builtin/predata_externals_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,12 @@ var _ = Describe("backup/predata_externals tests", func() {
9999
extTableDef.URIs = []string{"file://host:port/path/file"}
100100
testTable.ExtTableDef = extTableDef
101101
builtin.PrintExternalTableCreateStatement(backupfile, tocfile, testTable)
102-
testutils.ExpectEntry(tocfile.PredataEntries, 0, "public", "", "tablename", "TABLE")
102+
// In GPDB 7+ and Cloudberry, external tables are foreign tables
103+
expectedObjectType := "TABLE"
104+
if (connectionPool.Version.IsGPDB() && connectionPool.Version.AtLeast("7")) || connectionPool.Version.IsCBDBFamily() {
105+
expectedObjectType = "FOREIGN TABLE"
106+
}
107+
testutils.ExpectEntry(tocfile.PredataEntries, 0, "public", "", "tablename", expectedObjectType)
103108
testutils.AssertBufferContents(tocfile.PredataEntries, buffer, `CREATE READABLE EXTERNAL TABLE public.tablename (
104109
) LOCATION (
105110
'file://host:port/path/file'

0 commit comments

Comments
 (0)