function configCell = genHadoopConfig(matFile)
% This function will dig into an input MAT file
% that contains a datastore object and return the configuration
% details for use in the Compiler UI
ld = load(matFile);
f = fieldnames(ld);
for idx = 1:length(f)
    if  matlab.io.datastore.internal.shim.isHadoopFileBased(ld.(f{idx}))
        name = regexp(class(ld.(f{idx})), '[^\.]*?(?=(Datastore)?$)','match', 'once');
        isfullfile='false';
        if ( matlab.io.datastore.internal.shim.isFullfile(ld.(f{idx})) )
            isfullfile = 'true';
        end
        configCell = ...
            {'mw.ds.in.type', lower(name), ...
             'mw.ds.in.fullfile', isfullfile };
        return;
    end
end

% If we got here, we don't have a datastore object in the MAT file
throw(MException('Compiler:InvalidDatastore','Invalid datastore file'));
