NSInMemoryStoreType 与 group by fetch 请求不兼容吗?

Mic*_*ala 5 xcode core-data swift

我想在单元测试中使用NSPersistentContainer类型存储NSInMemoryStoreType。我有一些实体想要按日期分组,并且我想为其编写单元测试。

实例化内存持久化容器的代码:

let container = NSPersistentContainer(name: "DataModel")
let storeDescription = NSPersistentStoreDescription()
storeDescription.type = NSInMemoryStoreType
container.persistentStoreDescriptions = [storeDescription]
container.loadPersistentStores { (storeDescription, error) in
    print(storeDescription)
    if let loadingError = error {
       print(loadingError.localizedDescription)
    }
 }
Run Code Online (Sandbox Code Playgroud)

我收到的错误:

caught "NSInvalidArgumentException", "Unsupported fetch request: store <NSMemoryObjectStore: 0x6000002c9bc0> (URL: file:///dev/null) does not support GROUP BY"
Run Code Online (Sandbox Code Playgroud)

当我使用 SQLite 支持的 NSPersistentContainer 时,一切正常。内存容器是否可能与 group by 请求不兼容?我认为各种类型的容器是可以互换的。