GPUdb C++ API  Version 7.2.3.0
create_table_external.h
Go to the documentation of this file.
1 /*
2  * This file was autogenerated by the Kinetica schema processor.
3  *
4  * DO NOT EDIT DIRECTLY.
5  */
6 #ifndef __CREATE_TABLE_EXTERNAL_H__
7 #define __CREATE_TABLE_EXTERNAL_H__
8 
9 namespace gpudb
10 {
31  {
37  tableName(std::string()),
38  filepaths(std::vector<std::string>()),
39  modifyColumns(std::map<std::string, std::map<std::string, std::string> >()),
40  createTableOptions(std::map<std::string, std::string>()),
41  options(std::map<std::string, std::string>())
42  {
43  }
44 
1376  CreateTableExternalRequest(const std::string& tableName_, const std::vector<std::string>& filepaths_, const std::map<std::string, std::map<std::string, std::string> >& modifyColumns_, const std::map<std::string, std::string>& createTableOptions_, const std::map<std::string, std::string>& options_):
1377  tableName( tableName_ ),
1378  filepaths( filepaths_ ),
1379  modifyColumns( modifyColumns_ ),
1380  createTableOptions( createTableOptions_ ),
1381  options( options_ )
1382  {
1383  }
1384 
1393  std::string tableName;
1394 
1425  std::vector<std::string> filepaths;
1426 
1430  std::map<std::string, std::map<std::string, std::string> > modifyColumns;
1431 
1608  std::map<std::string, std::string> createTableOptions;
1609 
2301  std::map<std::string, std::string> options;
2302  };
2303 } // end namespace gpudb
2304 
2305 namespace avro
2306 {
2307  template<> struct codec_traits<gpudb::CreateTableExternalRequest>
2308  {
2309  static void encode(Encoder& e, const gpudb::CreateTableExternalRequest& v)
2310  {
2311  ::avro::encode(e, v.tableName);
2312  ::avro::encode(e, v.filepaths);
2313  ::avro::encode(e, v.modifyColumns);
2314  ::avro::encode(e, v.createTableOptions);
2315  ::avro::encode(e, v.options);
2316  }
2317 
2318  static void decode(Decoder& d, gpudb::CreateTableExternalRequest& v)
2319  {
2320  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
2321  {
2322  const std::vector<size_t> fo = rd->fieldOrder();
2323 
2324  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
2325  {
2326  switch (*it)
2327  {
2328  case 0:
2329  ::avro::decode(d, v.tableName);
2330  break;
2331 
2332  case 1:
2333  ::avro::decode(d, v.filepaths);
2334  break;
2335 
2336  case 2:
2337  ::avro::decode(d, v.modifyColumns);
2338  break;
2339 
2340  case 3:
2341  ::avro::decode(d, v.createTableOptions);
2342  break;
2343 
2344  case 4:
2345  ::avro::decode(d, v.options);
2346  break;
2347 
2348  default:
2349  break;
2350  }
2351  }
2352  }
2353  else
2354  {
2355  ::avro::decode(d, v.tableName);
2356  ::avro::decode(d, v.filepaths);
2357  ::avro::decode(d, v.modifyColumns);
2358  ::avro::decode(d, v.createTableOptions);
2359  ::avro::decode(d, v.options);
2360  }
2361  }
2362  };
2363 } // end namespace avro
2364 
2365 namespace gpudb
2366 {
2373  {
2379  tableName(std::string()),
2380  typeId(std::string()),
2381  typeDefinition(std::string()),
2382  typeLabel(std::string()),
2383  typeProperties(std::map<std::string, std::vector<std::string> >()),
2384  countInserted(int64_t()),
2385  countSkipped(int64_t()),
2386  countUpdated(int64_t()),
2387  info(std::map<std::string, std::string>()),
2388  files(std::vector<std::string>())
2389  {
2390  }
2391 
2396  std::string tableName;
2397 
2403  std::string typeId;
2404 
2408  std::string typeDefinition;
2409 
2413  std::string typeLabel;
2414 
2419  std::map<std::string, std::vector<std::string> > typeProperties;
2420 
2424  int64_t countInserted;
2425 
2430  int64_t countSkipped;
2431 
2436  int64_t countUpdated;
2437 
2441  std::map<std::string, std::string> info;
2442 
2443  std::vector<std::string> files;
2444  };
2445 } // end namespace gpudb
2446 
2447 namespace avro
2448 {
2449  template<> struct codec_traits<gpudb::CreateTableExternalResponse>
2450  {
2451  static void encode(Encoder& e, const gpudb::CreateTableExternalResponse& v)
2452  {
2453  ::avro::encode(e, v.tableName);
2454  ::avro::encode(e, v.typeId);
2455  ::avro::encode(e, v.typeDefinition);
2456  ::avro::encode(e, v.typeLabel);
2457  ::avro::encode(e, v.typeProperties);
2458  ::avro::encode(e, v.countInserted);
2459  ::avro::encode(e, v.countSkipped);
2460  ::avro::encode(e, v.countUpdated);
2461  ::avro::encode(e, v.info);
2462  ::avro::encode(e, v.files);
2463  }
2464 
2465  static void decode(Decoder& d, gpudb::CreateTableExternalResponse& v)
2466  {
2467  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
2468  {
2469  const std::vector<size_t> fo = rd->fieldOrder();
2470 
2471  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
2472  {
2473  switch (*it)
2474  {
2475  case 0:
2476  ::avro::decode(d, v.tableName);
2477  break;
2478 
2479  case 1:
2480  ::avro::decode(d, v.typeId);
2481  break;
2482 
2483  case 2:
2484  ::avro::decode(d, v.typeDefinition);
2485  break;
2486 
2487  case 3:
2488  ::avro::decode(d, v.typeLabel);
2489  break;
2490 
2491  case 4:
2492  ::avro::decode(d, v.typeProperties);
2493  break;
2494 
2495  case 5:
2496  ::avro::decode(d, v.countInserted);
2497  break;
2498 
2499  case 6:
2500  ::avro::decode(d, v.countSkipped);
2501  break;
2502 
2503  case 7:
2504  ::avro::decode(d, v.countUpdated);
2505  break;
2506 
2507  case 8:
2508  ::avro::decode(d, v.info);
2509  break;
2510 
2511  case 9:
2512  ::avro::decode(d, v.files);
2513  break;
2514 
2515  default:
2516  break;
2517  }
2518  }
2519  }
2520  else
2521  {
2522  ::avro::decode(d, v.tableName);
2523  ::avro::decode(d, v.typeId);
2524  ::avro::decode(d, v.typeDefinition);
2525  ::avro::decode(d, v.typeLabel);
2526  ::avro::decode(d, v.typeProperties);
2527  ::avro::decode(d, v.countInserted);
2528  ::avro::decode(d, v.countSkipped);
2529  ::avro::decode(d, v.countUpdated);
2530  ::avro::decode(d, v.info);
2531  ::avro::decode(d, v.files);
2532  }
2533  }
2534  };
2535 } // end namespace avro
2536 
2537 #endif // __CREATE_TABLE_EXTERNAL_H__
std::string tableName
Value of tableName.
A set of parameters for GPUdb::createTableExternal.
std::map< std::string, std::string > info
Additional information.
int64_t countInserted
Number of records inserted into the external table.
CreateTableExternalResponse()
Constructs a CreateTableExternalResponse object with default parameters.
CreateTableExternalRequest()
Constructs a CreateTableExternalRequest object with default parameters.
std::string typeLabel
The user-defined description associated with the table's structure.
CreateTableExternalRequest(const std::string &tableName_, const std::vector< std::string > &filepaths_, const std::map< std::string, std::map< std::string, std::string > > &modifyColumns_, const std::map< std::string, std::string > &createTableOptions_, const std::map< std::string, std::string > &options_)
Constructs a CreateTableExternalRequest object with the specified parameters.
std::map< std::string, std::string > createTableOptions
Options from GPUdb::createTable, allowing the structure of the table to be defined independently of t...
int64_t countUpdated
[Not yet implemented] Number of records updated within the external table.
std::map< std::string, std::map< std::string, std::string > > modifyColumns
Not implemented yet.
A set of results returned by GPUdb::createTableExternal.
std::string typeId
ID of the currently registered table structure type for this external table.
std::string typeDefinition
A JSON string describing the columns of the created external table.
std::string tableName
Name of the table to be created, in [ schema_name. ]table_name format, using standard name resolution...
std::vector< std::string > filepaths
A list of file paths from which data will be sourced;.
std::map< std::string, std::vector< std::string > > typeProperties
A mapping of each external table column name to an array of column properties associated with that co...
std::map< std::string, std::string > options
Optional parameters.
int64_t countSkipped
Number of records skipped, when not running in abort error handling mode.