package main

import (
	"fmt"

	"git.cems.dev/cdricms/bdooc/proto"
)

func main() {
	// f, err := os.Open("50000 Records.csv")
	// if err != nil {
	// 	fmt.Println(err)
	// }

	// defer f.Close()

	// reader := csv.NewReader(f)

	// employees, err := parsing.UnmarshalEmployees(reader)
	// if err != nil {
	// 	fmt.Println(err)
	// }

	// data := parsing.MapToProto(employees)
	// data.SaveToFile("employee_data.bin")

	// fmt.Println(employees[:10])

	data, err := proto.LoadFromFile("employee_data.bin")
	if err != nil {
		fmt.Println(err)
	}

	// fmt.Println('F')

  _, err = data.QueryEmployeesByColumn(proto.FieldGender, "70")
	if err != nil {
		fmt.Println(err)
	}

  // fmt.Println(res)

	// r := proto.AggregateByColumn(data, proto.FieldRegion, func(ep proto.EmployeePList) float64 {
	// 	return proto.Max(ep, proto.FieldSalary)
	// })
	// fmt.Println(r)
	// r = proto.AggregateByColumn(data, proto.FieldRegion, func(ep proto.EmployeePList) float64 {
	// 	return proto.Min(ep, proto.FieldSalary)
	// })
	// fmt.Println(r)
	// for key := range result {
	//   fmt.Println(key)
	// }
}
