`CREATE TABLE test (x Int32, y Int32, s String, PRIMARY KEY (x, y)) ENGINE = MergeTree;`
should be equivalent to
`CREATE TABLE test (x Int32, y Int32, s String) ENGINE = MergeTree PRIMARY KEY (x, y);`
partition_by_key = args.storage_def->partition_by->ptr();
        
        
        
        metadata.partition_key = KeyDescription::getKeyFromAST(partition_by_key, metadata.columns, args.context);
        if (!args.storage_def->order_by)
            throw Exception(
                "You must provide an ORDER BY expression in the table definition. "
                "If you don't want this table to be sorted, use ORDER BY tuple()",
                ErrorCodes::BAD_ARGUMENTS);
        
        
        
        
        
        metadata.sorting_key = KeyDescription::getSortingKeyFromAST(
            args.storage_def->order_by->ptr(), metadata.columns, args.context, merging_param_key_arg);
        
        if (args.storage_def->primary_key)
        {
            metadata.primary_key = KeyDescription::getKeyFromAST(args.storage_def->primary_key->ptr(), metadata.columns, args.context);
        }
        else 
        {
            metadata.primary_key = KeyDescription::getKeyFromAST(args.storage_def->order_by->ptr(), metadata.columns, args.context);
            
            
            metadata.primary_key.definition_ast = nullptr;
        }
        if (args.storage_def->sample_by)