protected List<ColumnFamilyHandle> openRocksDB(final DBOptions dbOptions,
                                                   final ColumnFamilyDescriptor defaultColumnFamilyDescriptor,
                                                   final ColumnFamilyDescriptor... columnFamilyDescriptors) {
        final String absolutePath = dbDir.getAbsolutePath();
        final List<ColumnFamilyDescriptor> extraDescriptors = Arrays.asList(columnFamilyDescriptors);
        final List<ColumnFamilyDescriptor> allDescriptors = new ArrayList<>(1 + columnFamilyDescriptors.length);
        allDescriptors.add(defaultColumnFamilyDescriptor);
        allDescriptors.addAll(extraDescriptors);

        try {
            final List<byte[]> allExisting = RocksDB.listColumnFamilies(userSpecifiedOptions, absolutePath);

            final List<ColumnFamilyDescriptor> existingDescriptors = new LinkedList<>();
            existingDescriptors.add(defaultColumnFamilyDescriptor);
            existingDescriptors.addAll(extraDescriptors.stream()
                    .filter(descriptor -> allExisting.stream().anyMatch(existing -> Arrays.equals(existing, descriptor.getName())))
                    .collect(Collectors.toList()));
            final List<ColumnFamilyDescriptor> toCreate = extraDescriptors.stream()
                    .filter(descriptor -> allExisting.stream().noneMatch(existing -> Arrays.equals(existing, descriptor.getName())))
                    .collect(Collectors.toList());
            final List<ColumnFamilyHandle> existingColumnFamilies = new ArrayList<>(existingDescriptors.size());
            db = RocksDB.open(dbOptions, absolutePath, existingDescriptors, existingColumnFamilies);
            final List<ColumnFamilyHandle> createdColumnFamilies = db.createColumnFamilies(toCreate);

            return mergeColumnFamilyHandleLists(existingColumnFamilies, createdColumnFamilies, allDescriptors);

        } catch (final RocksDBException e) {
            throw new ProcessorStateException("Error opening store " + name + " at location " + dbDir.toString(), e);
        }
    }
Open RocksDB while automatically creating any requested column families that don't yet exist.
streams/src/main/java/org/apache/kafka/streams/state/internals/RocksDBStore.java